Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:41902 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10182 invoked from network); 13 Nov 2008 18:19:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Nov 2008 18:19:21 -0000 Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 63.205.162.116 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 63.205.162.116 us-gw1.zend.com Windows 2000 SP4, XP SP1 Received: from [63.205.162.116] ([63.205.162.116:26657] helo=us-gw1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AA/BC-07308-9AF6C194 for ; Thu, 13 Nov 2008 13:19:21 -0500 Received: from [192.168.16.110] ([192.168.16.110]) by us-gw1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 13 Nov 2008 10:19:27 -0800 Message-ID: <491C6FAF.104@zend.com> Date: Thu, 13 Nov 2008 10:19:27 -0800 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: Lukas Kahwe Smith CC: Felipe Pena , Geoffrey Sneddon , PHP Internals References: <4900DB81.4000805@zend.com> <4900E150.1010607@dynom.nl> <49018FC3.90302@gmail.com> <1224854888.19390.89.camel@goldfinger.johannes.nop> <490609A1.7090400@gravitonic.com> <1225199800.878.0.camel@localhost> <3F3445975B55414BB4A214B32E178657@pc> <4A4FE9BC-F000-4AEE-A68C-8EFEA9DCD154@pooteeweet.org> <4910D3E5.4020406@zend.com> <237D5067-10C6-4D25-8CCF-FEF9FE44F6F6@googlemail.com> <1225973406.5465.18.camel@felipe> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 13 Nov 2008 18:19:27.0634 (UTC) FILETIME=[5D2F9F20:01C945BC] Subject: Re: [PHP-DEV] array_key_exists BC break From: stas@zend.com (Stanislav Malyshev) Hi! > Can anyone write up a summary of the situation and the options we have? Sure. A number of array functions in 5.2 accept arrays, but use HASH_OF to extract array value, which means they automatically accept objects if the object has working get_properties handler. In 5.3, such function use new API with 'a' parameter, which accepts only arrays proper. The proposal is to have some new parameter - say 'a%' - which would call HASH_OF on objects where it makes sense. The definition of "makes sense" is not clear yet, since, for example, sort() on some objects may make sense - if the object's get_properties returns real storage - or may not, if that handler returns the mere copy of the real data. We might use some interface as a marker - like ArrayAccess - though I'm not sure if it will work in all circumstances. > Also cant we some how automate the BC break testing for this (aka scan > all functions that accept an array with the old API in 5.2, pass it an > ArrayObject instance and see what happens and compare that to 5.3)? Yes we can ;) That should be not hard to do by looking at ones having 'a' in parameters in 5.3 and comparing how they react to arrays in 5.2 and in 5.3. Some of them, btw, might accept objects even though it doesn't make much sense - as above. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com