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
No error should be reported.
I'm not sure if we should consider that comparing to the only enum value possible also require to compare if the value is instanceof the enum
Did PHPStan help you today? Did it make you happy in any way?
No response
The text was updated successfully, but these errors were encountered:
@@ @@-PHP 8.1 – 8.3 (2 errors)+PHP 8.1 – 8.3 (1 error)
==========
-10: Parameter #1 $hello of function world expects string, string|null given.-15: Parameter #1 $hello of function world expects string, Hello|string|null given.+ 9: Instanceof between string and Hello will always evaluate to false.
PHP 7.2 – 8.0 (1 error)
==========
3: Syntax error, unexpected T_STRING on line 3
Full report
PHP 8.1 – 8.3 (1 error)
Line
Error
9
Instanceof between string and Hello will always evaluate to false.
Bug report
When in_array contains an enum, it break type detection
Code snippet that reproduces the problem
https://phpstan.org/r/b9e500a3-e3a8-466f-a540-fe7b3eb8f9ed
Expected output
No error should be reported.
I'm not sure if we should consider that comparing to the only enum value possible also require to compare if the value is instanceof the enum
Did PHPStan help you today? Did it make you happy in any way?
No response
The text was updated successfully, but these errors were encountered: