From:             peo at bsd-guide dot net
Operating system: OpenBSD 3.8
PHP version:      5.1.2
PHP Bug Type:     Unknown/Other Function
Bug description:  list() function problem

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 bug report at http://bugs.php.net/?id=36590&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=36590&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=36590&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=36590&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=36590&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=36590&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=36590&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=36590&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=36590&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=36590&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=36590&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=36590&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=36590&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=36590&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=36590&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=36590&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=36590&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=36590&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=36590&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=36590&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=36590&r=mysqlcfg

Reply via email to