Re: [discussion] add array_usearch()

From: 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 [email protected] to get a copy of this message
2014-02-06 Tjerk Meesters <[email protected]>:
> 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


Thread (11 messages)

« previous php.internals (#72344) next »