-
-
Notifications
You must be signed in to change notification settings - Fork 933
Closed
Labels
Milestone
Description
Bug report
In this situation there is an array defined with a fixed number of elements. Within a do-while loop elements are taken of the stack with the method array_shift. Within the do body an if-statements can break from this loop and the while section of the loop tests for the number of remaining elements. PHPStan doesn't recognize this however and fails with the message Comparison operation ">" between X and Y is always true.
Code snippet that reproduces the problem
https://phpstan.org/r/911404cc-308a-4334-ad23-a180a5dfccb7
Expected output
The error should not have been reported, because the list can be exhausted and will return false eventually.