Re: [PHP-DEV] [RFC] array_key_(first|last|index) functions proposal

2016-01-03 Thread Rowan Collins
On 01/01/2016 21:55, Paul Dragoonis wrote: Thus it would look like this: $val = $array[array_key_last($array)]; Or how about a matching set of array_value_* functions? Granted, we can currently use reset() and last() for array_value_first() and array_value_last(), but that always feels a bit

Re: [PHP-DEV] [RFC] array_key_(first|last|index) functions proposal

2016-01-01 Thread Paul Dragoonis
Hi John, Thanks for submitting the RFC. It just has one piece of something that I feel needs a bit of refinement. The balance of the $key and the $val is out of sync, with one param being by-val and one by-ref. You could simplify the function to remove the &$val altogether, since the function na

Re: [PHP-DEV] [RFC] array_key_(first|last|index) functions proposal

2016-01-01 Thread John Bafford
> On Jan 1, 2016, at 16:38, Bishop Bettini wrote: > > On Fri, Jan 1, 2016 at 3:44 PM, John Bafford 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 >

Re: [PHP-DEV] [RFC] array_key_(first|last|index) functions proposal

2016-01-01 Thread Bishop Bettini
On Fri, Jan 1, 2016 at 3:44 PM, John Bafford 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 th