in_array
with array of literals is always true when it is possible to contain the checked value.
#5668
Labels
Milestone
Bug report
When doing an
in_array
check on an array with string literals, it is always true if the checked string matches one of the literals.In both
has1
,has2
andhas3
the type is not correct, as the array may be empty, or contain another value.Code snippet that reproduces the problem
https://phpstan.org/r/2d2fb268-4ecd-4255-b8a2-312a0c7cbfaf
Expected output
Dumped types in order:
The text was updated successfully, but these errors were encountered: