Re: [RFC] [Discussion] array_first() and array_last()
| From: | Claude Pache | Date: | Sat, 05 Apr 2025 18:00:23 +0000 |
| Subject: | Re: [RFC] [Discussion] array_first() and array_last() | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-127048@lists.php.net to get a copy of this message | ||
> Le 5 avr. 2025 à 17:51, Niels Dossche <dossche.niels@gmail.com> a écrit :
>
> Hi internals
>
> I'm opening the discussion for the RFC "array_first() and array_last()".
> https://wiki.php.net/rfc/array_first_last
>
> Kind regards
> Niels
Hi Niels,
It is reasonable. I have a userland implementation of that in my codebase since long ago.
You missed the following point when discussing the behaviour for empty array:
* Consistent with
array_shift() and array_pop(), which are also about
retrieving the first, respectively the last element of an array.
—Claude