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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2019 The PHP Group
All rights reserved.
Last updated: Fri Dec 13 21:01:24 2019 UTC