ID:               35270
 Updated by:       [EMAIL PROTECTED]
 Reported By:      andrej at blueshoes dot org
-Status:           Open
+Status:           Feedback
 Bug Type:         Documentation problem
 Operating System: windows
 PHP Version:      Irrelevant
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip


Previous Comments:
------------------------------------------------------------------------

[2005-11-18 05:15:02] andrej at blueshoes dot org

Description:
------------
the documentation for each
http://www.php.net/manual/en/function.each.php has a caution which was
true for php up to 4.3.11, but it's not for 4.4.1 anymore. 

Reproduce code:
---------------
                $array   = array('a', 'b', 'c', 'd', 'e', 'f', 'g');
                $breakAt = 3;
                $i=0;
                while (list($key, $val) = each($array)) {
                        if ($i > $breakAt) break;
                        $i++;
                }
                $brray = $array;
                $aCurrent = current($array);
                $bCurrent = current($brray);
                
    $actual   = $aCurrent;
    $expected = 'a';
    $this->assertEquals($expected, $actual, "failed? could be a good
thing. check the code.");
                
    $actual   = $bCurrent;
    $expected = 'f';
    $this->assertEquals($expected, $actual, "failed? could be a good
thing.");


Expected result:
----------------
a or f

Actual result:
--------------
a or f


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=35270&edit=1

Reply via email to