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
After null coalescing PHPStan loses type information on all other properties of the array. The new type of those properties becomes a union of all used types in the array (e.g. bool|int|string|null). This error only happens when the array contains 63 or more properties. See snippet for more information.
This is currently a blocker for a larger typing project here at Crisp. Is there anything we can do to help out with the "Easy fix", @ondrejmirtes :)? Do you plan on simply increasing some constant that defines this behavior? Thank you!
Bug report
After null coalescing PHPStan loses type information on all other properties of the array. The new type of those properties becomes a union of all used types in the array (e.g.
bool|int|string|null
). This error only happens when the array contains 63 or more properties. See snippet for more information.Code snippet that reproduces the problem
https://phpstan.org/r/9926eff3-05d8-4444-8510-1ed26a8368d1
Expected output
PHPStan should remember the type of all properties in the array, regardless of usage of null coalescing or amount of properties.
Did PHPStan help you today? Did it make you happy in any way?
PHPStan helps us a lot during our daily work 😀
The text was updated successfully, but these errors were encountered: