Fix #79749: Converting FFI instances to bool fails#5776
Closed
cmb69 wants to merge 2 commits intophp:masterfrom
Closed
Fix #79749: Converting FFI instances to bool fails#5776cmb69 wants to merge 2 commits intophp:masterfrom
cmb69 wants to merge 2 commits intophp:masterfrom
Conversation
Casting objects to bool is supposed to yield `true`. Since the `cast_object` handler is required now, we have to implement the `_IS_BOOL` conversion there.
nikic
reviewed
Jun 29, 2020
ext/ffi/ffi.c
Outdated
| /* }}} */ | ||
|
|
||
| static int zend_fake_cast_object(zend_object *obj, zval *result, int type) | ||
| static int zend_cast_object(zend_object *obj, zval *result, int type) |
Member
Author
There was a problem hiding this comment.
Because it isn't a fake cast anymore, is it?
Member
There was a problem hiding this comment.
Still seems to be pretty fake to me ^^ zend_cast_object sounds like how the standard object handler would be called. (I guess the problem here is more that all of this is prefixed by zend_ for some reason, even though it has nothing to do with ZE.)
Member
Author
There was a problem hiding this comment.
Oh, seen this way, the renaming was a bad idea. Thanks!
The former name may easily be confused with a ZE standard object cast.
nikic
approved these changes
Jun 29, 2020
Member
Author
|
Thanks! Applied as aca621c. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Casting objects to bool is supposed to yield
true. Since thecast_objecthandler is required now, we have to implement the_IS_BOOLconversion there.