Issue #2342247 by martin107, Mile23: Within nested foreach loop you cannot use the same loop variable