Bug report
It seems that the type of $items is different depending on where in the loop you are - as in it is inferred like it is a run once loop. When actually because it’s a loop the types should be the same throughout.
Definitely terrible code example but a good demonstration.
Code snippet that reproduces the problem
https://phpstan.org/r/32a3c556-8022-4599-a675-e7cc7290e107
Expected output
Clean with no errors
Did PHPStan help you today? Did it make you happy in any way?
I will forever be a happy PHPStan user!