Language: by-ref param ASSIGN_REF rebinds local CV only (#22546)#22552
Merged
Conversation
Zend `$a =& $x` updates the named symbol table slot; peeling through a prior IS_REFERENCE incorrectly mutated the caller / previous referent. Co-authored-by: Cursor <cursoragent@cursor.com>
Cover function `global $g =&` disconnect and main-script `$GLOBALS` linkage alongside the by-ref param repro. Co-authored-by: Cursor <cursoragent@cursor.com>
3 tasks
Owner
Author
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
$a =& $xrebinds the named CV only; by-ref params must disconnect from the caller (php-srcZEND_ASSIGN_REF).$GLOBALSfetch-temp peels (Language: array element assign by reference — $arr[] = &$var must alias (zend_operators.c) #5349).Closes #22546
php-src reference
Zend/zend_vm_def.h—ZEND_ASSIGN_REFZend/zend_execute.c— by-ref arg binding + local symbol rebindPHP implementation
lib/VM.php—TYPE_ASSIGN_REFwrite-target selection viaresolveScopeSlotVariableNameTest plan
Trust probe (pre-claim)
php script/bootstrap-inventory.php --check→ OK 6433/6433release-readiness --json: inventory/spine/readme ok;north-star5-fastred on master (gen-0 mismatch Self-host M5: bootstrap-inventory argv driver size floor — grow beyond 451KB stub #8713) — unrelatedMade with Cursor