php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35092 next() misbehavior
Submitted: 2005-11-03 20:37 UTC Modified: 2005-11-03 20:58 UTC
From: phbaer at npw dot net Assigned:
Status: Not a bug Package: Arrays related
PHP Version: 4.4.1 OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: phbaer at npw dot net
New email:
PHP Version: OS:

 

 [2005-11-03 20:37 UTC] 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


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-03 20:58 UTC] sniper@php.net
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.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 11:01:34 2025 UTC