php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15750 reset() resets nested arrays too
Submitted: 2002-02-27 01:16 UTC Modified: 2002-02-28 05:40 UTC
From: yury at krasu dot ru Assigned:
Status: Not a bug Package: Arrays related
PHP Version: 4.0.6 OS: FreeBSD-4.3
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: yury at krasu dot ru
New email:
PHP Version: OS:

 

 [2002-02-27 01:16 UTC] yury at krasu dot ru
Thais kind of error does NOT occur at PHP4.1 for Win32, but I have no opportunity to check it at the same version PHP for FreeBSD.

Example:

<?
$group = array(array(1, 2, 3), array(4, 5, 6));
$count = 2;
for ($c = 0; $c < $count; $c++) {
  reset($group);
  while (list($i) = each($group)) {
    list($key, $val) = each($group[$i]);
    echo "$val ";
  }
}
?>

That scrips produces "1 4 2 5 " at PHP4.1.0@Win32
but "1 4 1 4" at PHP4.0.6@FreeBSD4.3


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-28 05:40 UTC] yohgaki@php.net
Sorry. We don't fix bugs for 4.0.6. It works as expected for current CVS. and 4.1.2. Use 4.1.2 ;)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 12:01:33 2025 UTC