Bug report
I think there is an issue with how PHPstan determines array shapes (even with bleeding edge on in 2.2) when code uses array_diff_keys and/or array_flip to remove keys from an input array.
\PHPStan\dumpType() shows exactly what I think it should in the example below, although it still finds an error when analyzing the code.
Code snippet that reproduces the problem
https://phpstan.org/r/d9895bff-575a-4f8f-bf31-9fb2d88d3425
Expected output
The only output from the above should be from dumpType(). The other reported error in the code about the returned array's shape should not be reported.
Did PHPStan help you today? Did it make you happy in any way?
We've cleaned up so much of our legacy code base thanks to PHPStan ... thank you for your work!
Bug report
I think there is an issue with how PHPstan determines array shapes (even with bleeding edge on in 2.2) when code uses
array_diff_keysand/orarray_flipto remove keys from an input array.\PHPStan\dumpType()shows exactly what I think it should in the example below, although it still finds an error when analyzing the code.Code snippet that reproduces the problem
https://phpstan.org/r/d9895bff-575a-4f8f-bf31-9fb2d88d3425
Expected output
The only output from the above should be from
dumpType(). The other reported error in the code about the returned array's shape should not be reported.Did PHPStan help you today? Did it make you happy in any way?
We've cleaned up so much of our legacy code base thanks to PHPStan ... thank you for your work!