#30968 [Csd->Bgs]: Incorrect foreach() behavior
| From: | derick@php.net | Date: | Fri, 03 Dec 2004 09:43:52 +0000 |
| Subject: | #30968 [Csd->Bgs]: Incorrect foreach() behavior | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-69762@lists.php.net to get a copy of this message | ||
ID: 30968
Updated by: derick@php.net
Reported By: cow at neondragon dot net
-Status: Closed
+Status: Bogus
Bug Type: Arrays related
Operating System: Windows XP
PHP Version: 4.3.10RC1
New Comment:
Not a bug in PHP -> bogus.
Previous Comments:
------------------------------------------------------------------------
[2004-12-03 10:27:46] cow at neondragon dot net
Sorry, I should have tried that earlier. It seemed like the php.ini I
was using from a previous version caused some problems; nothing to do
with any extensions. Sorry!
------------------------------------------------------------------------
[2004-12-02 23:42:24] derick@php.net
Works fine here, please remove all Zend extensions from your
configuration, and try again.
------------------------------------------------------------------------
[2004-12-02 23:30:33] cow at neondragon dot net
Description:
------------
I'm pretty sure this isn't supposed to happen - it didn't happen with
earlier versions of PHP, and nothing in the manual documents it. It
happens with the RC of 4.3.10.
Reproduce code:
---------------
<?php
$foo = array(1,2,3);
foreach ($foo as $i) {
print_r($i);
}
/*
Result of code:
Array ( [0] => 1 [1] => 0 )
Array ( [0] => 2 [1] => 1 )
Array ( [0] => 3 [1] => 2 )
*/
?>
Expected result:
----------------
The string 1, then string 2, then string 3 - not arrays each time.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30968&edit=1