Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:7076 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2375 invoked by uid 1010); 13 Jan 2004 23:01:27 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 2319 invoked from network); 13 Jan 2004 23:01:26 -0000 Received: from unknown (HELO stella.fastforwardnetwork.com) (209.51.153.50) by pb1.pair.com with SMTP; 13 Jan 2004 23:01:26 -0000 Received: (qmail 28624 invoked from network); 14 Jan 2004 00:05:53 -0000 Received: from p508aa864.dip.t-dialin.net (HELO hristov.com) (80.138.168.100) by d.goto.bg with SMTP; 14 Jan 2004 00:05:53 -0000 Message-ID: <4004785F.4050208@hristov.com> Date: Tue, 13 Jan 2004 23:59:43 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20031230 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Christian Schneider CC: internals@lists.php.net References: <40045BB4.4050000@hristov.com> <40046198.6010800@cschneid.com> <400466AB.2020502@hristov.com> <40047235.8020902@cschneid.com> In-Reply-To: <40047235.8020902@cschneid.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: new function? From: php@hristov.com (Andrey Hristov) 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 >