You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Language: readonly property hooks — set hook cannot assign to readonly backing store outside __construct (zend_compile.c) #4518
PHP 8.4 property hooks on readonly properties forbid writes to the backing value outside __construct, even from the property's own set hook (only get may read). Zend rejects invalid hook bodies at compile time or runtime per zend_compile.c / hook dispatch.
This compiler preprocesses hooks to __phpc_property_set_* methods (lib/SourcePreprocessor/PropertyHooks.php) and dispatches via lib/VM.php / lib/JIT/PropertyHookDispatch.php (#3145). Gap: a set hook that assigns $this->prop = … on a readonly promoted property may succeed on VM/JIT when Zend fatals or throws.
Root cause:php-cfg-property-readonly overlay was not reliably applied before compile, so ClassProperty::readonly stayed false and post-construct writes (including set-hook backing stores) were not guarded.
Fix:
Apply apply_php_cfg_property_readonly_overlay early in script/apply-patches.sh
VM: defer outer readonly check when a set hook will dispatch; enforce readonly on raw $this->prop = … inside the hook after __construct
Activity
PurHur commentedon Jun 7, 2026
claim: worker-lane-a — starting this run
Fix readonly property hook post-construct writes (#4518) (#7545)
PurHur commentedon Jun 7, 2026
Merged via #7545
Root cause:
php-cfg-property-readonlyoverlay was not reliably applied before compile, soClassProperty::readonlystayed false and post-construct writes (including set-hook backing stores) were not guarded.Fix:
apply_php_cfg_property_readonly_overlayearly inscript/apply-patches.sh$this->prop = …inside the hook after__constructtest/compliance/cases/language/readonly_property_hook_set.phptVerification (docker):