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

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to