Use zend_reflection_property_set_raw_value_* PHPAPI helpers when available#11
Merged
Conversation
34db4e5 to
da4bda2
Compare
da4bda2 to
b7931ce
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.
php/php-src#21763 has landed; the dc_set_raw_value_without_lazy_init fallback
and its per-request ReflectionProperty cache (cache, dtor, fn_proxy slot) are
now confined to PHP_VERSION_ID < 80600.
Add a nightly 8.6 CI job (promoting 8.5 to the stable matrix) so the new
PHPAPI path actually gets exercised.
b7931ce to
9991cc9
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.