Repository navigation
array_multisort(): allow inline array literals by reference (#12017) - #12023
Merged
Merged
Conversation
Zend materializes ephemeral array operands for array_multisort() variadic by-ref slots. Extend ReferencableCheck + JIT by-ref guards; sort() etc. unchanged. Co-authored-by: Cursor <cursoragent@cursor.com>
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
array_multisort([1,2], …)and multi-array inline literals now succeed like Zend — ephemeral array operands are allowed for variadic by-ref slots.sort([1,2])and other array mutators still reject inline literals.Closes #12017
php-src reference
ext/standard/array.c—php_array_multisortinline array materializationZend/zend_compile.c— ZEND_SEND_REF temp for inline arraysPHP implementation
lib/VM/ReferencableCheck.php—allowsEphemeralArrayLiteralByRef('array_multisort')lib/JIT.php— variadic by-ref JIT guard parityVerification
Made with Cursor