ID:               30496
 User updated by:  esartoni at omniaglobal dot net
 Reported By:      esartoni at omniaglobal dot net
 Status:           Open
 Bug Type:         Arrays related
 Operating System: Linux
 PHP Version:      4CVS-2004-10-20 (stable)
 New Comment:

With PHP v4.3.9 works ok!


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

[2004-10-20 15:17:40] esartoni at omniaglobal dot net

Description:
------------
foreach doesn't work as expected when using multidimensional arrays.

Reproduce code:
---------------
<?php
        $a=array();
        $a[]=array("one", "two", "three");
        $a[]=array("five", "six", "seven");
        
        // Code 1 (THIS DON'T WORK AS EXPECTED)
        foreach ($a as $value) {
                echo join(",", $value)."\n";
        }
/*
  This code below is a workaround:

        // Code 2 (THIS WORKS!)
        foreach ($a as $key => $value) {
                echo join(",", $value)."\n";
        }
*/
?>

Expected result:
----------------
one,two,three
five,six,seven

Actual result:
--------------
Array,0
Array,1


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


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

Reply via email to