-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
Labels
Milestone
Description
Bug report
It seems that a second rand() results in a false positive only when using rand(1, x). E.g. rand(0, 100) does not give an error.
Error:
Comparison operation "<" between int<5, max> and 5 is always false.
Code snippet that reproduces the problem
https://phpstan.org/r/f6cd6866-3de6-4034-8b7c-dc083bbc17c2
Another example, without the elseif:
https://phpstan.org/r/1db5d8ae-21df-46bd-8361-818e872964c0
Expected output
Expected output is no error. When rand(1, 100) is changed to something else like rand(0, 100) the error also disappears.
Reactions are currently unavailable