#35092 [Opn->Bgs]: next() misbehavior
| From: | sniper@php.net | Date: | Thu, 03 Nov 2005 19:58:58 +0000 |
| Subject: | #35092 [Opn->Bgs]: next() misbehavior | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-87495@lists.php.net to get a copy of this message | ||
ID: 35092
Updated by: sniper@php.net
Reported By: phbaer at npw dot net
-Status: Open
+Status: Bogus
Bug Type: Arrays related
Operating System: Linux
PHP Version: 4.4.1
New Comment:
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same.
Thank you for your interest in PHP.
Previous Comments:
------------------------------------------------------------------------
[2005-11-03 20:37:20] phbaer at npw dot net
Description:
------------
next() misbehaves:
it does not increment the internal position pointer with PHP 4.4.1
Reproduce code:
---------------
<?php
$test = array();
for ($i = 0; $i < 10; $i++) {
$test[] = $i;
}
while (next($test)) {
echo current($test) . "<br />";
}
?>
Expected result:
----------------
1
2
3
4
5
6
7
8
9
Actual result:
--------------
1
1
1
1
1
1
1
1
1
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35092&edit=1