Skip to content

Sync return type changes#5075

Merged
kocsismate merged 5 commits intophp:masterfrom
kocsismate:php85-sync8
Mar 8, 2026
Merged

Sync return type changes#5075
kocsismate merged 5 commits intophp:masterfrom
kocsismate:php85-sync8

Conversation

@kocsismate
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Member

@ndossche ndossche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks mostly right

Comment thread reference/fileinfo/functions/finfo-close.xml Outdated
Copy link
Copy Markdown
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems the image functions returned E_WARNING + false in PHP 7 but those got converted to ValueErrors in PHP 8

@kocsismate
Copy link
Copy Markdown
Member Author

It seems the image functions returned E_WARNING + false in PHP 7 but those got converted to ValueErrors in PHP 8

@Girgias Do you have a suggestion how I should document this?

Comment thread reference/image/functions/imageresolution.xml
@Girgias
Copy link
Copy Markdown
Member

Girgias commented Jan 30, 2026

It seems the image functions returned E_WARNING + false in PHP 7 but those got converted to ValueErrors in PHP 8

@Girgias Do you have a suggestion how I should document this?

I guess the usual way we do it, add an XML entity for the 8.0 changelog entry and maybe an XML entity for the paragraph to add to the new error/exceptions sections?

@kocsismate
Copy link
Copy Markdown
Member Author

@Girgias I am currently trying to address your review comment, but I noticed that the warnings + false return was related to the resource to object conversion, right? And afterwards Nikita corrected a bunch of misleading RETURN_FALSE calls: php/php-src@429378d#diff-00d1efef2247b288c86a6c3bfefac111a4774fbc5453fdc02dcf36c4a23da283R796

That said, I'm wondering if we have ever documented such changes? Usually only the parameter/return type change is documented in the changelog as far as I can remember. In case of ext/gd, the changelog already contains the following:

"image expects a GdImage
instance now; previously, a valid gd resource was expected."

So I'm wondering if the changelog about the return type change as well as the error section is really a must-have?

@Girgias
Copy link
Copy Markdown
Member

Girgias commented Mar 5, 2026

Oh false was only ever returned for ZPP failures? Yeah, then I don't think we need to document it as it's part of the old UB disclaimer.

@kocsismate
Copy link
Copy Markdown
Member Author

Yes, these function only ever returned false because of zend_fetch_resource(). If you have a look at php/php-src@8aad466#diff-00d1efef2247b288c86a6c3bfefac111a4774fbc5453fdc02dcf36c4a23da283L61 for example, you'll see that there was no other path which used to return false for imagefill().

Comment thread language-snippets.ent Outdated
@kocsismate kocsismate merged commit fcd9214 into php:master Mar 8, 2026
2 checks passed
@kocsismate kocsismate deleted the php85-sync8 branch March 8, 2026 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants