> Sean's not so much referring to his own problem as (like you said) the
> solution is a fairly simple matter of following strict coding practices.
yeah, i see.
but...
> when foreach assigns to a pre-existing
> reference target
it's not the problem of the second foreach, any usage of $j after the
1st foreach as &$j will hurt

<?php
$i = array('zero','one','two');
foreach ($i as &$j) { do something here }

for ($j = 0; $j < 10; $j ++) {
...
}

$i[2] is modified
?>

iirc, there was a discussion about foreach behavior(leave assigned
key/value variable not unset after foreach) last year already.
i'd like to see it solved too, but with a real fix.

Reply via email to