-
-
Notifications
You must be signed in to change notification settings - Fork 947
in_array cannot be used as null check #7153
Copy link
Copy link
Closed
phpstan/phpstan-src
#1430Labels
Description
Bug report
When trying to check if an array contains any NULL values. The in_array function can be used with the strict flag set.
However PHPStan is not picking up that the values cannot be null inside of the array.
Code snippet that reproduces the problem
https://phpstan.org/r/69897217-fd94-497b-9e98-4baa6b2b96db
Expected output
The output should mention string is givin instead of string|null.
Did PHPStan help you today? Did it make you happy in any way?
PHPStan is the best! We've worked around this issue with the help of Webmozart assert, but it not diminished our excitement in using PHPStan. Great job!
Reactions are currently unavailable