Re: Re: new function?
| From: | Andrey Hristov | Date: | Tue, 13 Jan 2004 22:59:43 +0000 |
| Subject: | Re: Re: new function? | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-7076@lists.php.net to get a copy of this message | ||
Hi,
I didn't write this function to be faster. You asked about array_intersect()
and I decided to bechmark (you didn't ask for it though). What I had in mind
when I decided to write it was to escape this :
if (in_array("some_element", $haystack) && in_array("other_element", $haystack) && in_array("third_element", $haystack))
which with this function will be :
in_array_all("first_element","second_element", "third_element", $haystack)
In addtion, I have no problem with the proposal the needles to be passed as an array as first parameter. I did the current proto in the way it's now since it's more consistent with in_array().
Finally, I hope that the list will decide.
Andrey
Christian Schneider wrote:
Hi Andrey, My personal feeling is that not enough people use this to make the pure speed improvement worth a new function. I guess the list will decide... - Chris