Use zend_reflection_property_set_raw_value_* PHPAPI helpers when available#11
Open
nicolas-grekas wants to merge 1 commit intomainfrom
Open
Use zend_reflection_property_set_raw_value_* PHPAPI helpers when available#11nicolas-grekas wants to merge 1 commit intomainfrom
nicolas-grekas wants to merge 1 commit intomainfrom
Conversation
aec9c46 to
34db4e5
Compare
…lable
PHP 8.6 exposes zend_reflection_property_set_raw_value{,_without_lazy_initialization}
as PHPAPI (php/php-src#21763), moving the lazy-prop
bookkeeping into ext/reflection. Use the PHPAPI direct on 8.6+ and keep the
userland ReflectionProperty round-trip as a fallback for 8.4 / 8.5.
Depends on php/php-src#21763 landing; holding here until the patch is merged
and the target PHP version is known.
34db4e5 to
da4bda2
Compare
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.
PHP 8.6 is adding
zend_reflection_property_set_raw_value{,_without_lazy_initialization}()asPHPAPI— see php/php-src#21763. Once that lands, the lazy-property bookkeeping thatdeepclone_hydrate(..., DEEPCLONE_HYDRATE_NO_LAZY_INIT)currently drives through a userlandReflectionPropertyround-trip can be replaced by a single direct PHPAPI call.This PR wires up the direct call under
#if PHP_VERSION_ID >= 80600, keeping the existing userland fallback (construct + invokesetRawValueWithoutLazyInitialization($obj, $value), with a per-request cache keyed onzend_property_info *) for 8.4 and 8.5.