Re: Strange foreach reference issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jan 8, 2012 at 12:29 AM, Tim Behrendsen <tim@xxxxxxxxxxxxxx> wrote:
> Hello,
>
> This sure looks like a bug, but maybe there's some subtlety going on that I
> don't understand, so I would appreciate some insight. After much debugging,
> I tracked down a bug in my code to this test program. My PHP version is
> 5.3.3, running under Fedora Linux.
>
> <?php
>    $row_list = array(
>        array(
>            'Title' => 'Title #1',
>        ),
>        array(
>            'Title' => 'Title #2',
>        ),
>        array(
>            'Title' => 'Title #3',
>        ) );
>
>    print "   Rows at start: " . print_r($row_list, true);
>    foreach ($row_list as $idx => &$row) {

Why is there an '&' before $row here? That seems like the problem to me..

Matijn

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




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux