Re: [PHP4BETA] BUG: arrays in lists
| From: | Zeev Suraski | Date: | Sat, 26 Feb 2000 15:20:05 +0000 |
| Subject: | Re: [PHP4BETA] BUG: arrays in lists | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-11042@lists.php.net to get a copy of this message | ||
There is no guarantee on the order of assignments in the list() construct.
so both 'blah = 2 = 1' and 'blah = 1 = 2' (and actually, also 'blah = 1 =
1' and 'blah = 2 = 2') are valid results. You simply cannot rely on this
order.
Zeev
On Sat, 26 Feb 2000, Faisal Nasim wrote:
> Hi,
>
> There is some implementation bug here!
>
> list ( $z , $x[] , $x[] ) = array ( "blah" , 1 , 2 );
> print "$z = $x[0] = $x[1]";
>
>
> PHP 4b4 pl1:
> blah = 2 = 1 (should be: blah = 1 = 2)
>
>
> PHP 4b3:
> blah = 1 = 2
>
>
> Let me know when its stabbed to death! ;-)
>
> Thank you!
>
> Faisal
>
> P.S. posted @ bugs.php.net
>
>
>
--
Zeev Suraski <zeev@zend.com>
http://www.zend.com/