|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-02-02 22:11 UTC] cythrawll at codeangel dot org
[2008-02-04 18:14 UTC] philip@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 07 12:00:02 2026 UTC |
Description: ------------ Documentation for key() function suggests it works only for associative arrays, however it works for both numerical and associative. PHP Manual for key() function states for the short description: key ? Fetch a key from an associative array Reproduce code: --------------- <?php $arr = array("test", "test2"); reset($arr); echo key($arr); next($arr); echo key($arr); ?> Expected result: ---------------- key ? Fetch a key from an array Actual result: -------------- key ? Fetch a key from an associative array