Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:7082 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88075 invoked by uid 1010); 14 Jan 2004 00:01:21 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 88041 invoked from network); 14 Jan 2004 00:01:20 -0000 Received: from unknown (HELO h24-68-209-231.gv.shawcable.net) (24.68.209.231) by pb1.pair.com with SMTP; 14 Jan 2004 00:01:20 -0000 Received: from zworg.com (localhost.localdomain [127.0.0.1]) by h24-68-209-231.gv.shawcable.net (8.12.8/8.12.8) with ESMTP id i0E00mKm008171; Tue, 13 Jan 2004 16:00:48 -0800 Message-ID: <400486B0.9070108@zworg.com> Date: Tue, 13 Jan 2004 16:00:48 -0800 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andrey Hristov CC: internals@lists.php.net References: <40045BB4.4050000@hristov.com> <40046198.6010800@cschneid.com> <400466AB.2020502@hristov.com> <40047235.8020902@cschneid.com> <4004785F.4050208@hristov.com> <40047CF0.8070306@zworg.com> <40047FD7.3010202@hristov.com> In-Reply-To: <40047FD7.3010202@hristov.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: new function? From: jdavidson@zworg.com (jason davidson) Andrey Hristov wrote: > Hi, > > jason davidson wrote: > >> >> I like the idea of passing an array of needles, I wonder if you could >> just add the ability to pass a needles array to in_array, rather than >> create a new function. >> Anyways, it adds flexability, I would use it. >> >> Jason >> > Unfortunately, in_array() cannot be modified since this will break BC. > Consider this example : > php -r '$a = array(1, 2); $haystack = array("string", array(1, 2), > 5.5); var_dump(in_array($a, $haystack));' > > So, in_array() checks for everything, including arrays, starting PHP5 > it can look for objects too. So the BC is that till now an array as > first parameter is quite ok therefore > it cannot be changed. > > > Andrey > Sorry, i hadnt even realized that you could already pass needles array into in_array, and now i beleive ive missed the whole point of this thread.. Im done.. :) J