Bug report
If $x is known to take a finite number of values that is a subset of the values of an array $a, then in_array($x, $a, true) should be detected as always evaluating to true.
Code snippet that reproduces the problem
https://phpstan.org/r/203d39d9-cdf0-4f11-bf13-aa40dbe26dda
Expected output
On line 5: “Function in_array() with arguments string, array{'a', 'b', 'c'} and true will always evaluate to true.”
Did PHPStan help you today? Did it make you happy in any way?
No response
Bug report
If
$xis known to take a finite number of values that is a subset of the values of an array$a, thenin_array($x, $a, true)should be detected as always evaluating to true.Code snippet that reproduces the problem
https://phpstan.org/r/203d39d9-cdf0-4f11-bf13-aa40dbe26dda
Expected output
On line 5: “Function in_array() with arguments string, array{'a', 'b', 'c'} and true will always evaluate to true.”
Did PHPStan help you today? Did it make you happy in any way?
No response