On Wed, 20 Oct 2010 08:37:55 +0200, php-gene...@garydjones.name (Gary)
wrote:

>Better. I can tell you how to solve it:
>    $a = array('a', 'b','c');
>    foreach($a as &$row){
>        //you don't have to do anything here
>    }
>    unset($row); // <----<<< THIS IS KEY!
>    print_r($a);
>    foreach($a as $row){
>        echo "<br />".$row;
>    }
>    print_r($a);

I don't quite I follow this. I'll have to try it when I have time (I
hope later today) to understand what you're proposing.

Unfortunately it won't work in this, for one or two reasons.

The first possible reason is that I'm not referencing the "as"
variable with an ampersand. If I'd have to add one to fix this
problem, it might cause other problems.

The second (definite) reason is that I can't read the array
destructively (with an unset). The problem occurs in code that is
preparing the array for later read-only use, so that would be
self-defeating!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to