From 9bd06a0d9d2e45e10347d95f1543d9e9cae5d688 Mon Sep 17 00:00:00 2001 From: Torben Wilson Date: Thu, 27 Aug 2009 04:48:24 +0000 Subject: [PATCH] Document the fact that key() returns NULL when the array pointer is out of bounds. Addresses Bug #47330. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@287789 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/array/functions/key.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/reference/array/functions/key.xml b/reference/array/functions/key.xml index b8b31b5344..2d1ada0862 100644 --- a/reference/array/functions/key.xml +++ b/reference/array/functions/key.xml @@ -35,7 +35,11 @@ &reftitle.returnvalues; - Returns the index. + The key function simply returns the + key of the array element that's currently being pointed to by the + internal pointer. It does not move the pointer in any way. If the + internal pointer points beyond the end of the elements list or the array is + empty, key returns &null;.