Skip to content

Use zend_reflection_property_set_raw_value_* PHPAPI helpers when available#11

Merged
nicolas-grekas merged 1 commit into
mainfrom
zend-reflection-rpsv-api
Jun 30, 2026
Merged

Use zend_reflection_property_set_raw_value_* PHPAPI helpers when available#11
nicolas-grekas merged 1 commit into
mainfrom
zend-reflection-rpsv-api

Conversation

@nicolas-grekas

@nicolas-grekas nicolas-grekas commented Apr 15, 2026

Copy link
Copy Markdown
Member

PHP 8.6 is adding zend_reflection_property_set_raw_value{,_without_lazy_initialization}() as PHPAPI — see php/php-src#21763. Once that lands, the lazy-property bookkeeping that deepclone_hydrate(..., DEEPCLONE_HYDRATE_NO_LAZY_INIT) currently drives through a userland ReflectionProperty round-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 + invoke setRawValueWithoutLazyInitialization($obj, $value), with a per-request cache keyed on zend_property_info *) for 8.4 and 8.5.

@nicolas-grekas nicolas-grekas force-pushed the zend-reflection-rpsv-api branch 2 times, most recently from 34db4e5 to da4bda2 Compare April 16, 2026 12:12
@nicolas-grekas nicolas-grekas force-pushed the zend-reflection-rpsv-api branch from da4bda2 to b7931ce Compare June 30, 2026 09:47
…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.
@nicolas-grekas nicolas-grekas force-pushed the zend-reflection-rpsv-api branch from b7931ce to 9991cc9 Compare June 30, 2026 09:51
@nicolas-grekas nicolas-grekas merged commit 9991cc9 into main Jun 30, 2026
21 checks passed
@nicolas-grekas nicolas-grekas deleted the zend-reflection-rpsv-api branch June 30, 2026 10:01
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.

1 participant