To answer part of your question:

>One more thing: whether this bug is fixed or not, the 
>documentation must 
>be clarified! I don't know about you, but I simply don't 
>understand what 
>it's supposed to say. Quoting: "Note:  Also note that foreach operates 

What the documentation means is that 

<?php foreach($foo as $key=>$val) {
        $val = "newval";
        } 
?>

Will not change every element in the $foo array to "newval". However,
although $foo cannot be modified by modifying $key and $val the internal
array pointer WILL increment as if you were actually working on that
array directly.. So in order to restore the internal array pointer back
to the start of the array you'd need a call to reset($foo) first. 

Side note: You can still modify the values within $foo by:

<?php foreach($foo as $key=>$val) {
                $foo[$key] = "newval";
        }
?>


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to