function noloop(array $foo) {
if ($undefined) {}
}
function loop(array $foo) {
foreach ($foo as $bar) {
if ($undefined) {}
}
}
4: Undefined variable: $undefined
9: Undefined variable: $undefined
4: Undefined variable: $undefined
9: Variable $undefined might not be defined.
I think this was the root of the confusion in #821 (comment)
Expected:
Actual:
https://phpstan.org/r/d64a6ad0-4cff-4eb6-95be-ef00b57596c1