Fix ?? on property hooks without get-hook invocation (#8902) - #8915
Merged
Conversation
Zend checks hooked-property backing for ?? / ??= before invoking get hooks. Wire compiler coalesce lowering and VM backing fetch; resolve php-cfg call-arg temp clones so var_dump($obj->hook ?? default) uses the coalesce result slot. Co-authored-by: Cursor <cursoragent@cursor.com>
4 tasks
Keep compileCallArgCoalesceSlot before compileHoistedEmptyCallArg. Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Jun 16, 2026
PurHur
added a commit
that referenced
this pull request
Jun 16, 2026
3 tasks
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.
Summary
??/??=on hooked properties now null-check and read backing storage instead of invoking get hooks (parity withZend/zend_property_hooks.c, pairs with Language: ??= on property hooks must invoke get/set hooks (zend_property_hooks.c) #6472??=).issetForCoalesceAssign,propertyHookCoalesceRead), stmt-levelPropertyFetch; Coalescefusion, and call-arg temp clone resolution (Regression: backed enum case loose == with backing scalar returns true (re-#5798, zend_operators.c) #8766).fetchObjectPropertyForCoalesce()for left-branch reads without get hook.php-src reference
Zend/zend_property_hooks.c— isset/coalesce backing probeZend/zend_compile.c—ZEND_AST_COALESCEon hooked propertiesVerification
Output:
Closes #8902
Made with Cursor