Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39784 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12205 invoked from network); 8 Aug 2008 23:00:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Aug 2008 23:00:59 -0000 Authentication-Results: pb1.pair.com header.from=helly@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=helly@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 85.214.94.56 as permitted sender) X-PHP-List-Original-Sender: helly@php.net X-Host-Fingerprint: 85.214.94.56 aixcept.net Linux 2.6 Received: from [85.214.94.56] ([85.214.94.56:46229] helo=h1149922.serverkompetenz.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3D/C1-02575-920DC984 for ; Fri, 08 Aug 2008 19:00:59 -0400 Received: from MBOERGER-ZRH.corp.google.com (133-155.107-92.cust.bluewin.ch [92.107.155.133]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by h1149922.serverkompetenz.net (Postfix) with ESMTP id B93C911DB44; Sat, 9 Aug 2008 01:00:53 +0200 (CEST) Date: Sat, 9 Aug 2008 01:00:08 +0200 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <122515992.20080809010008@marcus-boerger.de> To: Stanislav Malyshev CC: Marcus Boerger , 'PHP Internals' In-Reply-To: <489CCB62.8010406@zend.com> References: <489CAD75.2060404@zend.com> <1961502655.20080809000521@marcus-boerger.de> <489CC5BD.4060701@zend.com> <221319091.20080809002725@marcus-boerger.de> <489CCB62.8010406@zend.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] by-ref return & inheritance From: helly@php.net (Marcus Boerger) Hello Stanislav, Saturday, August 9, 2008, 12:40:34 AM, you wrote: > Hi! >> Yes, it breaks the principle. E.g. caller knows callee returns by ref - you >> break this, as easy as that. > I'm sorry I think you misunderstood my proposal. I proposed allowing > overriding this: > public function __get($name) > with this: > public function &__get($name) > but not the reverse. So if the caller known callee returns by ref - it > means it already expects the child class, not the parent class. Thus, it > does not break anything. > Is there any other problem that you see? What makes you think there won't be a problem with the reverse. The caller does not expect a reference but the calle returns one? In OOP the return value of the derived class' method must be an instance of the class defined by the base class' method or a subclasse of that. And so far we tream them different, rather than a reference is a subclass of a normal value or vice versa. Best regards, Marcus