ID:               46210
 Updated by:       [EMAIL PROTECTED]
 Reported By:      anvergdr at gmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Arrays related
 Operating System: windows xp
 PHP Version:      5.2.6
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

The manual clearly states you need to use reset() to reset the internal
array pointer after each() if you want to traverse the array again.


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

[2008-10-01 12:42:48] anvergdr at gmail dot com

Description:
------------
I assigned an associated array using each function from an array. But
when using the list function the first element is not displaying. When
commenting the second associated array which was created using the each
function the code outputs all the values.

Reproduce code:
---------------
<?php
        
        $Greetings = array(     'First'=>'January', 'Second'=>'February',
'Third'=>'March',       'Fourth'=>'April', 'Fifth'=>'May');
        
        $CurrentGreeting = each($Greetings);
        
        while(list($Language, $Greeting)= each($Greetings))
                {
                        echo $Language . ' is  ' .$Greeting ."<br />";
                }       
                
?>

Expected result:
----------------
First is January
Second is February
Third is March
Fourth is April
Fifth is May


Actual result:
--------------
Second is February
Third is March
Fourth is April
Fifth is May



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


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

Reply via email to