#30968 [Fbk-Csd]: Incorrect foreach() behavior

2004-12-03 Thread cow at neondragon dot net
 ID:   30968
 User updated by:  cow at neondragon dot net
 Reported By:  cow at neondragon dot net
-Status:   Feedback
+Status:   Closed
 Bug Type: Arrays related
 Operating System: Windows XP
 PHP Version:  4.3.10RC1
 New Comment:

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!


Previous Comments:


[2004-12-02 23:42:24] [EMAIL PROTECTED]

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=30968edit=1


#30968 [NEW]: Incorrect foreach() behavior

2004-12-02 Thread cow at neondragon dot net
From: cow at neondragon dot net
Operating system: Windows XP
PHP version:  4.3.10RC1
PHP Bug Type: Arrays related
Bug description:  Incorrect foreach() behavior

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 bug report at http://bugs.php.net/?id=30968edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=30968r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=30968r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=30968r=trysnapshot51
Fixed in CVS:http://bugs.php.net/fix.php?id=30968r=fixedcvs
Fixed in release:http://bugs.php.net/fix.php?id=30968r=alreadyfixed
Need backtrace:  http://bugs.php.net/fix.php?id=30968r=needtrace
Need Reproduce Script:   http://bugs.php.net/fix.php?id=30968r=needscript
Try newer version:   http://bugs.php.net/fix.php?id=30968r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=30968r=support
Expected behavior:   http://bugs.php.net/fix.php?id=30968r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=30968r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=30968r=submittedtwice
register_globals:http://bugs.php.net/fix.php?id=30968r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=30968r=php3
Daylight Savings:http://bugs.php.net/fix.php?id=30968r=dst
IIS Stability:   http://bugs.php.net/fix.php?id=30968r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=30968r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=30968r=float
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=30968r=mysqlcfg