On 2025-04-05 18:51, Niels Dossche wrote:
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,
Do you think it would be hard or wrong to add `array_nth`? I've had more
trouble with that as the in-place implementation is usually pretty
unreadable, e.g.
array_slice(array_values($array), $offset, 1)[0] ?? null
I understand this need is less common, especially compared to
`array_first`. But I also suspect that an in-engine implementation might
have more performance gains compared to an userland one.
BR,
Juris