Skip to content

Use zend_reflection_property_set_raw_value_* PHPAPI helpers when available#11

Open
nicolas-grekas wants to merge 1 commit intomainfrom
zend-reflection-rpsv-api
Open

Use zend_reflection_property_set_raw_value_* PHPAPI helpers when available#11
nicolas-grekas wants to merge 1 commit intomainfrom
zend-reflection-rpsv-api

Conversation

@nicolas-grekas
Copy link
Copy Markdown
Member

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

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 from aec9c46 to 34db4e5 Compare April 15, 2026 16:58
…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.
@nicolas-grekas nicolas-grekas force-pushed the zend-reflection-rpsv-api branch from 34db4e5 to da4bda2 Compare April 16, 2026 12:12
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