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
quick question about this one that confused me - the core problem is the combination of
a) phpstan resolving string when accessing the potential unset $in['maybe']https://phpstan.org/r/16baf67e-2c9b-4018-af1a-b8ebbf3a7200
in combination with
b) the typespecifier specifying string for $in['maybe'] via is_string($in['maybe'] ?? null) which is no new info and therefore leads to ImpossibleCheckTypeHelper returning true
I'm not entirely sure if this should/can be fixed in the type specifying code or somewhere else. my initial idea was to make the scope resolve such unsafe offsets "correctly" (e.g. string|null), but that is surely wrong, right? that would break many many things I suppose
ok, I played around a bit and figured it out I think. of course changing how unsafe ArrayDimFetch expressions are resolved does not make sense. this should be fixable in the type specifier 😊
Bug report
Code snippet that reproduces the problem
https://phpstan.org/r/f0b56620-fd83-4fd4-9c03-9e85afdfa2c3
Expected output
No errors
Did PHPStan help you today? Did it make you happy in any way?
The text was updated successfully, but these errors were encountered: