#44016 [Opn->Csd]: Key function documentation implies it only works for associative arrays

From: Date: Mon, 04 Feb 2008 18:14:24 +0000
Subject: #44016 [Opn->Csd]: Key function documentation implies it only works for associative arrays
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-500@lists.php.net to get a copy of this message
ID: 44016 Updated by: philip@php.net Reported By: cythrawll at codeangel dot org -Status: Open +Status: Closed Bug Type: Documentation problem PHP Version: Irrelevant New Comment: This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. Previous Comments: ------------------------------------------------------------------------ [2008-02-02 22:11:19] cythrawll at codeangel dot org fixed spelling ------------------------------------------------------------------------ [2008-02-01 21:50:39] cythrawll at codeangel dot org 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=44016&edit=1

« previous php.doc.bugs (#500) next »