Skip to content
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

ArrayMapFunctionReturnTypeExtension does not take into account for variable length argument expansion #10527

Open
ryium opened this issue Feb 2, 2024 · 0 comments · May be fixed by phpstan/phpstan-src#2901

Comments

@ryium
Copy link

ryium commented Feb 2, 2024

Bug report

array_map can accept a variable length argument after the second argument, but if you use the spread syntax added since PHP 7.4, the type is not correctly inferred and a type mismatch occurs.

Code snippet that reproduces the problem

https://phpstan.org/r/7ce82708-6a53-4e31-8c8d-97dd46bb6bb4

Expected output

Expect no errors

Did PHPStan help you today? Did it make you happy in any way?

I feel the benefits of my work and hobbies almost every day! <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant