'If any part of LIST is an array, "foreach" will get very confused > if you add or remove elements within the loop body, for example with > "splice". So don't do that.' > > Your testing seems to prove that this is a special case, certainly a > very useful one. > Please explain what makes it special. The 'last' makes it special. By exiting the loop there is no opportunity for confusion.But I did not find see "Anyway, don't do it, even with "last"" advices :(
In reply to Re^4: foreach argument modification inside loop, followed by return from loop
by vsespb
in thread foreach argument modification inside loop, followed by return from loop
by vsespb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |