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
Sorry, digging up another weird exotic edge case here.. In general is_a is working quite well, but there are problems with class-string types in a falsey scope only. Object types in a falsey scope work just fine.
Bug report
Sorry, digging up another weird exotic edge case here.. In general
is_a
is working quite well, but there are problems with class-string types in a falsey scope only. Object types in a falsey scope work just fine.As
is_subclass_of
works really similar and both of them have type specyfing extensions, I assume there could be similar problems there. So maybe something found via https://github.com/phpstan/phpstan/issues?q=is%3Aissue+is%3Aopen+is_subclass_of is relatedMaybe phpstan/phpstan-src#1039 is related too and we can take over adaptions from there. I did not thoroughly check yet tbh.
I'm happy to try fixing this myself later.
Code snippet that reproduces the problem
https://phpstan.org/r/6823a8c6-a4f2-456b-a7d5-995b70feef2d
Expected output
No errors.
Did PHPStan help you today? Did it make you happy in any way?
Initially I thought there are more problems with
is_a
, then I figured out I was testing wrong and PHPStan outsmarted me again ;)The text was updated successfully, but these errors were encountered: