Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65701 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60541 invoked from network); 6 Feb 2013 17:53:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Feb 2013 17:53:29 -0000 Authentication-Results: pb1.pair.com header.from=glopes@nebm.ist.utl.pt; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=glopes@nebm.ist.utl.pt; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain nebm.ist.utl.pt from 193.136.128.22 cause and error) X-PHP-List-Original-Sender: glopes@nebm.ist.utl.pt X-Host-Fingerprint: 193.136.128.22 smtp2.ist.utl.pt Linux 2.6 Received: from [193.136.128.22] ([193.136.128.22:34943] helo=smtp2.ist.utl.pt) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B0/00-60491-89892115 for ; Wed, 06 Feb 2013 12:53:29 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp2.ist.utl.pt (Postfix) with ESMTP id 5C5987000450; Wed, 6 Feb 2013 17:53:25 +0000 (WET) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at ist.utl.pt Received: from smtp2.ist.utl.pt ([127.0.0.1]) by localhost (smtp2.ist.utl.pt [127.0.0.1]) (amavisd-new, port 10025) with LMTP id SoXBW78Qp4pR; Wed, 6 Feb 2013 17:53:25 +0000 (WET) Received: from mail2.ist.utl.pt (mail.ist.utl.pt [IPv6:2001:690:2100:1::8]) by smtp2.ist.utl.pt (Postfix) with ESMTP id DE07E700044E; Wed, 6 Feb 2013 17:53:24 +0000 (WET) Received: from damnation.nl.lo.geleia.net (unknown [IPv6:2001:470:94a2:4:21d:baff:feee:cc0b]) (Authenticated sender: ist155741) by mail2.ist.utl.pt (Postfix) with ESMTPSA id 86C5220084A2; Wed, 6 Feb 2013 17:53:23 +0000 (WET) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Etienne Kneuss" , "Anthony Ferrara" Cc: "Mike Willbanks" , "PHP Internals" References: Date: Wed, 06 Feb 2013 18:53:18 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Organization: =?utf-8?Q?N=C3=BAcleo_de_Eng=2E_Biom=C3=A9di?= =?utf-8?Q?ca_do_I=2ES=2ET=2E?= Message-ID: In-Reply-To: User-Agent: Opera Mail/12.12 (Linux) Subject: Re: [PHP-DEV] ArrayAccess/ArrayObject return by reference From: glopes@nebm.ist.utl.pt ("Gustavo Lopes") On Wed, 06 Feb 2013 17:47:15 +0100, Anthony Ferrara wrote: > Perhaps there's another way out of this. A simple way would be to > introduce an ArrayAccessReference interface in core that adds the > references to the > getters/setters... > > It's perhaps not the cleanest, but it solves the BC issues... How would this solve anything? The BC problem is that ArrayObject doesn't return by reference. If we made it return by reference, almost all* the now valid subclasses that also do not return by reference would issue an E_STRICT. *"almost" because you can override ArrayObject's offsetGet and return by reference. Those would be compatible with the modification in ArrayObject. We've allowed overrides to return by reference when the parent doesn't for quite a while now. -- Gustavo Lopes