Code snippet that reproduces the problem
https://phpstan.org/r/49a3d04d-8e39-4420-b0cd-66a0db7fa541
Old example: https://phpstan.org/r/0eededac-4378-4914-8928-ce5cb34cba85
Problem
The fact that the contents of the while block is never executed is not taken into account, leading PHPStan to incorrectly conclude that the first entry of the array is always present and has a constant value.
Still an issue as of PHPStan version 0.12.28.