-
-
Notifications
You must be signed in to change notification settings - Fork 933
Closed
Closed
Copy link
Labels
Milestone
Description
Bug report
I just noticed that phpstan/phpstan-src#2589 doesn't seem to play well with strict rules.
This example without strict rules works: https://phpstan.org/r/6187bcca-8fc8-459b-9790-21a82e62b345
But when I enable strict rules, I need to cast the return value of preg_match() to a bool and this seems to block the types from passing through. For example: https://phpstan.org/r/f368fc07-6438-43f1-b80b-93dee22535f4
Same thing happens when I cast to an int: https://phpstan.org/r/0d011355-4446-4bd8-9b8d-0c44907f9a07
Code snippet that reproduces the problem
Expected output
No issue should have been detected
Did PHPStan help you today? Did it make you happy in any way?
No response
mvorisek