W dniu 2.06.2023 o 03:24, Hans Henrik Bergan pisze:
sounds like array_find could be implemented by just adding a new flag
for array_filter's $mode:
ARRAY_FILTER_STOP_ON_FIRST_MATCH
or some such?

array_filter is guaranteed to always return an array and we should not change it.
Flags are used just to decide what should be sent to a callback.

In my other e-mail I have just proposed adding similiar flags to array_find function as you have it now in array_filter, so it can be used to search by keys and/or values.

Best regards,
Janusz

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to