-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
Description
Bug report
Hi! First, thank you for making our lives easier as developers ❤️.
I found what appears to be a bug concerning current, array_reverse and early terminations.
Code snippet that reproduces the problem
https://phpstan.org/r/ec522ffe-804c-496f-9738-96a45a8c3a59
Error: Function test() should return string but returns string|false.
Expected output
No error should be thrown, because the empty check before and the thrown exception ensure that $meters is not empty.
array_reverse only reverses the array, so we can be sure that $reversedMeters is not empty either.
Same code without the array_reverse part works:
https://phpstan.org/r/572d01d4-b0e9-4411-bb36-30ce38197657
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels