ID: 30496
Updated by: [EMAIL PROTECTED]
Reported By: esartoni at omniaglobal dot net
-Status: Open
+Status: Bogus
Bug Type: Arrays related
Operating System: Linux
PHP Version: 4CVS-2004-10-20 (stable)
New Comment:
Works fine here.
Previous Comments:
------------------------------------------------------------------------
[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