ID:               47264
 Updated by:       col...@php.net
 Reported By:      george at shoutbomb dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Arrays related
 Operating System: windows 2003
 PHP Version:      5.2.8
 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.

That's because you don't move the array pointer. See next().


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

[2009-02-01 23:04:57] george at shoutbomb dot com

Description:
------------
When requesting the 'current' pointer in an array it always returns the
'first' item.

Reproduce code:
---------------
$search_array = array('first' => 1, 'second' => 4,'third' => 51,
'fourth' => 54,'fifth' => 15);
if (array_key_exists('fourth', $search_array)) {
    echo current($search_array);
}

Expected result:
----------------
Expecting the 'fourth' item.

Actual result:
--------------
Always returns the 'first' item.


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


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

Reply via email to