-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[8.x] Fix forwarded call with named arguments #40421
Conversation
Is it possible this |
It was added as a replacement for There are several other very similar places in the framework doing this kind of thing with Honestly my guess is that |
I don't think you can even unpack an array with string keys until PHP 8.1? |
I've tested this on PHP 8 and 8.1 and it works in function arguments (but not in something like |
It's fine on PHP 7.4 because there aren't named arguments, so the |
Okay cool, I just tried it with |
Last comment I swear 😅 after looking through every |
This PR fixes one instance where passing named arguments is currently broken.
Laravel's support policy is very clear that named arguments are not guaranteed to be backwards-compatible:
However, the
array_values
call that this PR removes explicitly prevents named arguments from being used at all, even if the developer is using them intentionally and understands the implications of doing so.I understand that there are a lot of strong opinions about whether named arguments are a good idea, and personally I agree with the decision to exclude them from any backwards-compatibility guarantees, but they are part of the language so it makes sense for it to at least be possible to use them.
See also #38066.