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

I'm sorry derick but here with v4.3.10-dev doesn't work!

I've also tried with Solaris (SPARC) with same results.


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

[2004-10-20 15:34:28] [EMAIL PROTECTED]

Works fine here.

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

[2004-10-20 15:19:33] esartoni at omniaglobal dot net

With PHP v4.3.9 works ok!

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

[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