Re: [discussion] add array_usearch()
| From: | Kingsquare.nl - Robin Speekenbrink | Date: | Thu, 06 Feb 2014 15:53:21 +0000 |
| Subject: | Re: [discussion] add array_usearch() | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-72344@lists.php.net to get a copy of this message | ||
2014-02-06 Tjerk Meesters <tjerk.meesters@gmail.com>:
> Hi internals,
>
> To complement array_search(), I'm gauging the interest in adding the
> following function:
>
> mixed array_usearch(array $haystack, callable $fn, int $flags = 0)
>
> It returns the first array key from a given haystack for which the callback
> function returns a truthy value [1] or
false otherwise. The
> callback
> function receives the array item as its only argument [2].
>
>
Tjerk,
This feels alot like array_filter.. Do we really want to introduce yet
another way of doing almost the same?
Regards,
Robin Speekenbrink