Skip to content

Fix mixing named and unnamed parameters in PHP 7 - #48

Merged
thekid merged 6 commits into
mainfrom
fix/mixed-named-parameters-php7
Sep 14, 2025
Merged

Fix mixing named and unnamed parameters in PHP 7#48
thekid merged 6 commits into
mainfrom
fix/mixed-named-parameters-php7

Conversation

@thekid

@thekidthekid commented Sep 14, 2025

Copy link
Copy Markdown
Member

The following code returned 1, 2, 0 instead of the correct 1, 0, 2:

uselang\Reflection;
class T {
publicstaticfunctioncreate($a, $b= 0, $c= 0) {
return [$a, $b, $c];
}
}
$t= Reflection::type(T::class)->method('create')->invoke(null, [1, 'c' => 2]);
echoimplode(', ', $t), "\n";

@thekidthekid changed the title Fix missing named and unnamed parameters in PHP 7Fix mixing named and unnamed parameters in PHP 7Sep 14, 2025
@thekidthekid added the bug Something isn't working label Sep 14, 2025
@thekid
thekid merged commit 95f41d5 into mainSep 14, 2025
14 checks passed
@thekid
thekid deleted the fix/mixed-named-parameters-php7 branch September 14, 2025 08:49
@thekid

Copy link
Copy Markdown
MemberAuthor

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugSomething isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@thekid