ID:               35545
 Updated by:       [EMAIL PROTECTED]
 Reported By:      kervala at jpopdb dot net
-Status:           Open
+Status:           Bogus
 Bug Type:         Variables related
 Operating System: Linux 2.4
 PHP Version:      5.1.1
 New Comment:

The result of this code is unknown in all languages: 
$years[$i] = $i--;


Previous Comments:
------------------------------------------------------------------------

[2005-12-04 13:04:47] kervala at jpopdb dot net

Description:
------------
For my site, I used a piece of code which always worked fine. (see
below)

It's a simple PHP code using a "for" loop and variables manipulation.


Reproduce code:
---------------
for($i=date("Y")+1; $i>=1970; $years[$i] = $i--);
        
print_r($years);


Expected result:
----------------
In all previous PHP versions, it returned :

2006 => 2006,
2005 => 2005,
etc...


Actual result:
--------------
It now returns :

2005 => 2006,
2004 => 2005,
etc...



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=35545&edit=1

Reply via email to