Hello internals,
On 15.06.2018 at 00:37, Enno Woortmann wrote:
I've added the "Open Issues" section to the RFC and added the idea of
Côme and Gabriel to add the corresponding functions for handling the
values of the outer elements of an array to provide a complete set of
functions.
Currently I see three possibilities to handle the idea. Either extend
the scope of the RFC to cover also the handling of the values, which
could be implemented rather fast and by reusing a lot of code as the
current implementation already gathers the bucket for the first/last
element of an array, or move this idea to a future scope which should
be covered by a separate RFC. The third alternative would be to skip
the implementation of the corresponding functions.
In my opinion it's a good idea to complete the function set by also
providing functions for the handling of array values. Both
opportunities which would lead to the completed set are practicable in
my view.
I've extended the scope of the RFC to cover additionally the functions
array_value_first($array) and array_value_last($array).
The updated RFC is still available at
https://wiki.php.net/rfc/array_key_first_last
<https://deref-web-02.de/mail/client/3lM0ZbRqSMo/dereferrer/?redirectUrl=https%3A%2F%2Fwiki.php.net%2Frfc%2Farray_key_first_last>
I've added a commit to the pull request located at
https://github.com/php/php-src/pull/3256
<https://deref-web-02.de/mail/client/bEY-xQctqjI/dereferrer/?redirectUrl=https%3A%2F%2Fgithub.com%2Fphp%2Fphp-src%2Fpull%2F3256> to
add the implementation and the tests for the extended scope.
Regards,
Enno