Bug report (version 0.12.42)
If you have a queue with single item in it, phpstan seems to think that array_pop() returns null.
Code snippet that reproduces the problem
https://phpstan.org/r/57010e6f-71f7-4b56-9e14-e6b55b87cf47
function foo(): void
{
$queue = ['asd'];
$list = [];
do {
$current = array_pop($queue);
if ($current === null) {
break;
}
$list[] = $current;
} while ($queue);
}
Output
Line 10: Unreachable statement - code above always terminates.
Expected output
No error