You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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 methodarray_shift
. Within thedo
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 messageComparison 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.
The text was updated successfully, but these errors were encountered: