On Fri, Jan 1, 2016 at 3:44 PM, John Bafford <jbaff...@zort.net> wrote:

> Happy New Year, everyone!
>
> I’d like to present the first new PHP RFC for this year, a proposal to add
> functions to easily get the first, last, or an arbitrary key (and value) by
> index from an array, taking advantage of PHP’s property that arrays are
> ordered maps.
>

Thanks for submitting this RFC!  I am +1, with one quibble: obtaining the
value by reference seems non-sequitur to the function itself and PHP in
general.  IOW, this seems more PHPesque to me:

// get the next to last value
$key = array_key_index($arr, -2);
$val = $arr[$key];

Sincerely,
bishop

Reply via email to