ID:               36590
 Updated by:       [EMAIL PROTECTED]
 Reported By:      peo at bsd-guide dot net
-Status:           Open
+Status:           Bogus
 Bug Type:         Unknown/Other Function
 Operating System: OpenBSD 3.8
 PHP Version:      5.1.2
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Read the manual page


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

[2006-03-02 13:41:54] peo at bsd-guide dot net

Description:
------------
list() seems to fill in the variable values "backwards", which results
in the array index variable being incremented before all values are
assigned.


Reproduce code:
---------------
<?php
  $ads=array();

  $i=0;
  $date = "2006-01-30";
  $nr = "00423364";
  $file = "2006-01-30_00423364.jpg";
  list($ads[$i]['publ'],$ads[$i]['nr'],$ads[$i++]['fil']) =
array($date,$nr,$file);

  print_r($ads);

?>


Expected result:
----------------
Array
(
    [0] => Array
        (
            [fil] => 2006-01-30_00423364.jpg
            [nr] => 00423364
            [publ] => 2006-01-30
        )

)

(as in 5.0.4)

Actual result:
--------------
Array
(
    [0] => Array
        (
            [fil] => 2006-01-30_00423364.jpg
        )

    [1] => Array
        (
            [nr] => 00423364
            [publ] => 2006-01-30
        )

)



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


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

Reply via email to