Elements in for are flattened to a list before processing. The array should be ignored after the initial entry into the loop--it will only process the list it created. It should be safe to add elements to the array, though I would hesitate to rely on this behavior.
"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.
In reply to Re: changing array size in foreach loop: is it safe?
by hardburn
in thread changing array size in foreach loop: is it safe?
by Errto
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |