Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:7080 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48293 invoked by uid 1010); 13 Jan 2004 23:33:20 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 48230 invoked from network); 13 Jan 2004 23:33:20 -0000 Received: from unknown (HELO stella.fastforwardnetwork.com) (209.51.153.50) by pb1.pair.com with SMTP; 13 Jan 2004 23:33:20 -0000 Received: (qmail 32382 invoked from network); 14 Jan 2004 00:37:46 -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:37:46 -0000 Message-ID: <40047FD7.3010202@hristov.com> Date: Wed, 14 Jan 2004 00:31:35 +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: jason davidson 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> In-Reply-To: <40047CF0.8070306@zworg.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, 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