-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
Labels
Milestone
Description
Bug report
PHPStan is able to recognize a condition using instanceof syntax (eg: if ($foo instanceof Bar)), but not a condition using the ::class syntax (eg: if ($foo::class === Bar::class)) to determine the object class.
This result in that break in EasyAdmin project: https://github.com/EasyCorp/EasyAdminBundle/pull/5813/files#r1247414831
Code snippet that reproduces the problem
https://phpstan.org/r/0c84ecb2-1b23-42a8-9161-a32f7096c5b8
https://phpstan.org/r/05f9613a-d9cf-4321-986e-247723efcbb9
Expected output
if ($foo instanceof Bar) should be equivalent to if ($foo::class === Bar::class)
Did PHPStan help you today? Did it make you happy in any way?
No response
Reactions are currently unavailable