Re: [PATCH] New functions: array_key_index(), array_first(), array_last()
| From: | Antony Dovgal | Date: | Sat, 06 Jan 2007 12:14:27 +0000 |
| Subject: | Re: [PATCH] New functions: array_key_index(), array_first(), array_last() | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-27298@lists.php.net to get a copy of this message | ||
On 01/05/2007 08:49 AM, John Bafford wrote:
Hello, Attached is a patch and corresponding test file I would like to submit for inclusion in PHP. I would like this patch to be included in PHP 5.2.1, as it is entirely new code (and thus shouldn't cause regressions), but as RC2 was just released earlier today, I understand if it must wait until PHP 5.2.2. This patch implements three new functions, as described below. mixed array_key_index(array input, int index [, mixed value]) Return the array's index'th key (and optionally, value) mixed array_first(array input [, mixed value]) Return the array's first key (and optionally, value) This is equivalent to array_key_index($input, 0 [, $value]); mixed array_last(array input [, mixed value]) Return the array's last key (and optionally, value) This is equivalent to array_key_index($input, -1 [, $value]);-1 Implementing these functions _in_ PHP can't take more than a minute. -- Wbr, Antony Dovgal