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

From: Date: Sun, 03 Jan 2016 18:35:20 +0000
Subject: Re: [RFC] array_key_(first|last|index) functions proposal
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-89979@lists.php.net to get a copy of this message
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 ugly to me. The name "reset" is hardly obvious, and the side-effects of "resetting the internal array pointer" even less so (e.g. how does it affect copy-on-write?). Regards, -- Rowan Collins [IMSoP]

« previous php.internals (#89979) next »