Repository navigation
Conversation
Previous some places passed return_value_ptr only if the function
returned by reference. Now return_value_ptr is always set, even
for functions returning by-reference.
This allows you to return zvals without copying their contents. For
this purpose two new macros RETVAL_ZVAL_FAST and RETURN_ZVAL_FAST
are added:
RETVAL_ZVAL_FAST(zv); /* Analog to RETVAL_ZVAL(zv, 1, 0) */
RETURN_ZVAL_FAST(zv); /* Analog to RETURN_ZVAL(zv, 1, 0) */
These macros behave similarly to the non-FAST versions with
copy=1 and dtor=0, with the difference that the FAST versions
will try return the zval without copying by utilizing return_value_ptr.
Contributor
|
I'm not a programmer, so sorry my innocent question - isn't this a BC break ? |
Member
Author
|
@kaplanlior I don't see how this would break BC. Can you provide more info on what you mean? |
Member
|
maybe, some extensions use if (return_value_ptr) { do some stuff returning ref }however, I don't think it is a big issue |
|
Comment on behalf of nikic at php.net: merged |
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.
Previous some places passed
return_value_ptronly if the function returned by reference. Nowreturn_value_ptris always set, even for functions returning by-value.This allows you to return zvals without copying their contents. For this purpose two new macros
RETVAL_ZVAL_FASTandRETURN_ZVAL_FASTare added:These macros behave similarly to the non-FAST versions with copy=1 and dtor=0, with the difference that the FAST versions will try return the zval without copying by utilizing
return_value_ptr.