I can't reproduce this issue on https://phpstan.org/try, is the rule overwriteVariablesWithLoop set to true there?
If I use foreach twice I got error on second run Foreach overwrites $var with its value variable. But $var is local variable here so it shouldn't be reported imho.
foreach ($variable as $var) {
// do something
}
foreach ($variable as $var) {
// do something else
}
I can't reproduce this issue on https://phpstan.org/try, is the rule
overwriteVariablesWithLoopset totruethere?If I use foreach twice I got error on second run
Foreach overwrites $var with its value variable.But $var is local variable here so it shouldn't be reported imho.