Re: Allow Iterator to be used with current, next, reset, key functions

From: Date: Sun, 30 Oct 2016 23:21:05 +0000
Subject: Re: Allow Iterator to be used with current, next, reset, key functions
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14  Groups: php.internals 
Request: Send a blank email to internals+get-96667@lists.php.net to get a copy of this message
On 30/10/2016 23:10, Fleshgrinder wrote:
/** Get and remove the first element from the array. */ function array_take_first(array $array); /** Get and remove the last element from the array. */ function array_take_last(array $array);
These two already exist; they're called array_shift() and array_pop(). The need for new functions for array_first() and array_last() is precisely for when you *don't* want to modify the array. Regards, -- Rowan Collins [IMSoP]

« previous php.internals (#96667) next »