Retain fixed arguments in func_get_args for variadic functions - #109
Open
yavon007 wants to merge 2 commits into
Open
Retain fixed arguments in func_get_args for variadic functions#109yavon007 wants to merge 2 commits into
yavon007 wants to merge 2 commits into
Conversation
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.
For
function f($head, ...$tail), callingf(1, 2, 3)currently makesfunc_get_args()return[2, 3]. The generator emits the fixed-argument arrayas a discarded expression and then merges only the variadic tail into an empty
result temporary.
Initialize the result temporary with the fixed arguments before the existing
variadic merge. Correct the legacy mixed-parameter expectation and add focused
codegen and PHP/AOT behavioral regression coverage.
Validation: 4 focused PHPUnit tests / 28 assertions pass. Compiled cases for
multiple fixed parameters, empty and pure variadic tails, and fixed-reference
updates match PHP stdout with empty stderr. The updated legacy fixture also
matches its EXPECT. Linux ARM64, PHP 8.5.10 ZTS, PHPX 4b3a472, GCC O2.
This narrowly fixes lost fixed parameters. Existing differences for omitted
defaults, unknown named variadic arguments, and variadic-array mutations remain;
the change does not claim complete PHP argument-introspection compatibility.