Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:41739 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61777 invoked from network); 6 Nov 2008 21:06:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Nov 2008 21:06:37 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=Johannes.Schlueter@Sun.COM; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 192.18.6.24 as permitted sender) X-PHP-List-Original-Sender: johannes@php.net X-Host-Fingerprint: 192.18.6.24 gmp-eb-inf-2.sun.com Solaris 10 (beta) Received: from [192.18.6.24] ([192.18.6.24:39653] helo=gmp-eb-inf-2.sun.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AA/88-44653-B5C53194 for ; Thu, 06 Nov 2008 16:06:36 -0500 Received: from fe-emea-10.sun.com (gmp-eb-lb-1-fe3.eu.sun.com [192.18.6.10]) by gmp-eb-inf-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id mA6L6W0Z006408 for ; Thu, 6 Nov 2008 21:06:33 GMT Received: from conversion-daemon.fe-emea-10.sun.com by fe-emea-10.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) id <0K9X00E01JTTGO00@fe-emea-10.sun.com> (original mail from johannes@php.net) for internals@lists.php.net; Thu, 06 Nov 2008 21:06:32 +0000 (GMT) Received: from [192.168.1.103] ([93.104.99.54]) by fe-emea-10.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPSA id <0K9X008AOJYBBND0@fe-emea-10.sun.com>; Thu, 06 Nov 2008 21:06:20 +0000 (GMT) Date: Thu, 06 Nov 2008 22:06:09 +0100 In-reply-to: <49133302.4040701@zend.com> Sender: Johannes.Schlueter@Sun.COM To: Stanislav Malyshev Cc: Felipe Pena , Geoffrey Sneddon , Lukas Kahwe Smith , PHP Internals Message-ID: <1226005570.4679.12.camel@goldfinger.johannes.nop> MIME-version: 1.0 X-Mailer: Evolution 2.22.3.1 (2.22.3.1-1.fc9) Content-type: text/plain Content-transfer-encoding: 7BIT 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> <49133302.4040701@zend.com> Subject: Re: [PHP-DEV] array_key_exists BC break From: johannes@php.net (Johannes =?ISO-8859-1?Q?Schl=FCter?=) On Thu, 2008-11-06 at 10:10 -0800, Stanislav Malyshev wrote: > Hi! > > > So as suggested and wished, here is a patch that add a modifier '%' to > > 'a' in parameter parsing API, where it allows object that implements > > ArrayAccess to be accept. Although it doesn't invoke any their methods, > > i.e. just how it works nowdays. > > I think if you use HASH_OF then any object having get_properties should > be fine... Is there any reason to restrict it to ArrayAccess? This can be wrong/strange with classes implementing ArrayAccess (not ArrayObject) or Iterator. An example where one might expect an Iterator, reset() and next() use HASH_OF in 5.2: some real property And another example using ArrayAccess: array_key_exists uses HASH_OF in 5.2: bool(true) So allowing passing objects to array stuff using HASH_OF can lead to unexpected behavior. Dropping the old behavior makes this clear ... but is bad for stuff like ArrayObject. I'm not sure whether we should add special rules for a single class though .. johannes