You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This seems like a crazy edge case. I have a function that takes a nullable mixed array. When I call this function and pass in a list that's built using the unpacked result of a function, I get an error:
function foo expects array<int, mixed>|null, array<int, string> given.
Bug report
This seems like a crazy edge case. I have a function that takes a nullable mixed array. When I call this function and pass in a list that's built using the unpacked result of a function, I get an error:
Code snippet that reproduces the problem
Here is the error:
https://phpstan.org/r/d2c5bf08-d6bf-4888-ab7c-9a1db035688b
The error disappears when the function parameter is not nullable.
https://phpstan.org/r/db2aa007-c7e2-484d-9ddc-3e336f2ac91d
The error also disappears when we do not unpack the result of another function.
https://phpstan.org/r/4fe5bcde-068f-4767-996e-46eba8af5f00
Expected output
I expect this to produce no errors.
Did PHPStan help you today? Did it make you happy in any way?
PHPStan speeds up my code reviews!
The text was updated successfully, but these errors were encountered: