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
When a function receives false as a parameter to a call that is using a template, false is treated as bool. This is very prominent in optional functions that return a second value if the first one does not fulfill a condition.
I think this code should pass. I understand why PHPStan assumes that a parameter with a false value is a boolean, but since it is (in the example) never true, it could just as well be treated as false.
Did PHPStan help you today? Did it make you happy in any way?
Yes. PHPStan is like the three reviewers I do not have. <3
The text was updated successfully, but these errors were encountered:
Bug report
When a function receives
false
as a parameter to a call that is using a template, false is treated asbool
. This is very prominent in optional functions that return a second value if the first one does not fulfill a condition.Code snippet that reproduces the problem
https://phpstan.org/r/f005b006-ae63-4d4e-8b78-7e7e802f53a7
Expected output
I think this code should pass. I understand why PHPStan assumes that a parameter with a false value is a boolean, but since it is (in the example) never true, it could just as well be treated as false.
Did PHPStan help you today? Did it make you happy in any way?
Yes. PHPStan is like the three reviewers I do not have. <3
The text was updated successfully, but these errors were encountered: