#30914 [Csd->Bgs]: foreach returns the wrong value
| From: | derick@php.net | Date: | Fri, 26 Nov 2004 15:25:33 +0000 |
| Subject: | #30914 [Csd->Bgs]: foreach returns the wrong value | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-69494@lists.php.net to get a copy of this message | ||
ID: 30914
Updated by: derick@php.net
Reported By: phpbug at billmann-edv dot net
-Status: Closed
+Status: Bogus
Bug Type: Arrays related
Operating System: Linux
PHP Version: 4.3.10RC1
New Comment:
Not a bug in PHP -> bogus.
Previous Comments:
------------------------------------------------------------------------
[2004-11-26 16:18:41] phpbug at billmann-edv dot net
ok, I just realized that this only happens when you use the
ZendOptimizer 2.5.5. Without it and with the new version 2.5.7 it works
like expected...
Sorry for the noise ;-)
------------------------------------------------------------------------
[2004-11-26 16:12:07] derick@php.net
This works fine here, do you use any accelerator or cache?
------------------------------------------------------------------------
[2004-11-26 16:02:21] phpbug at billmann-edv dot net
Description:
------------
foreach returns the wrong results. Taking a look at the simple example
code and the result should make any more explanations unnecessary...
;-)
Reproduce code:
---------------
foreach ( array ( 1 ) as $data ) {
var_dump ( $data );
}
Expected result:
----------------
int(1)
Actual result:
--------------
array(2) {
[0]=>
int(1)
[1]=>
int(0)
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30914&edit=1