-
-
Notifications
You must be signed in to change notification settings - Fork 934
Closed
phpstan/phpstan-src
#4425Labels
Milestone
Description
Bug report
After upgrade from 2.1.11 to 2.1.12 I am getting a new error. Type mixed is being reduced to mixed~string after conditional exception throw. But the condition is not checking just if the type is string, therefore type reduction should not happen. https://3v4l.org/ZZRTQ
It would be also useful to include the reduced type in error message (same way as \PHPStan\dumpType() does), because currently the error message does not make sense.
- Call to function is_string() with mixed will always evaluate to false.
+ Call to function is_string() with mixed~string will always evaluate to false.Code snippet that reproduces the problem
https://phpstan.org/r/ae539277-b604-4b6c-a09f-b4454daae7f7
Expected output
No error
Did PHPStan help you today? Did it make you happy in any way?
No response