Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39785 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 17064 invoked from network); 8 Aug 2008 23:47:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Aug 2008 23:47:23 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.198.231 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.198.231 rv-out-0506.google.com Received: from [209.85.198.231] ([209.85.198.231:57940] helo=rv-out-0506.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6D/82-02575-A0BDC984 for ; Fri, 08 Aug 2008 19:47:22 -0400 Received: by rv-out-0506.google.com with SMTP id g37so1244881rvb.23 for ; Fri, 08 Aug 2008 16:47:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=D0jTID187FDWmXbREdd9nHlxZrDAAhi3JRGNsiQ/aiU=; b=NuJRJYNrliK0RqJ35MQJe3QfOaw26jjqbBRD0tNyCU+LYZQiRg/PqGw1B4BSrtKUbL pEBbu4vDgn/m3YR7CrOBf33mmHibp3Xf7STJoX9sx74UkjPsv/+nPh1i1eaRJ6/UwGoh fE6o5KRRfa7vHGAmDiw3WCPYicrSCIiVp9/Rs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=F625Mo9oOdH3Ah/L0PHUnspWRRpQ1mp4OGCzMcOuYLJi9lMYD1bRimTcgWUh5e2cX9 mKvoG8LOzFVUj7pNApvLRQCvl+JLbafZiIS25J+Y3hPDCG0WZAEsnJKdi64x9hmoLXBS x8DVnaGQA8qsXbjv4G4OK9/2n4L3xSfiFGgFk= Received: by 10.140.148.3 with SMTP id v3mr1768180rvd.139.1218239239082; Fri, 08 Aug 2008 16:47:19 -0700 (PDT) Received: by 10.141.185.2 with HTTP; Fri, 8 Aug 2008 16:47:19 -0700 (PDT) Message-ID: Date: Sat, 9 Aug 2008 01:47:19 +0200 To: "Marcus Boerger" Cc: "Stanislav Malyshev" , "PHP Internals" In-Reply-To: <122515992.20080809010008@marcus-boerger.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <489CAD75.2060404@zend.com> <1961502655.20080809000521@marcus-boerger.de> <489CC5BD.4060701@zend.com> <221319091.20080809002725@marcus-boerger.de> <489CCB62.8010406@zend.com> <122515992.20080809010008@marcus-boerger.de> Subject: Re: [PHP-DEV] by-ref return & inheritance From: pierre.php@gmail.com ("Pierre Joye") hi Stanislav , Marcus, On Sat, Aug 9, 2008 at 1:00 AM, Marcus Boerger wrote: > 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. I know that we don't like to add new magic methods, but this case seems to require new ones. What's about __getByRef (and its setter equivalent if it is also not supported yet)? Cheers, -- Pierre http://blog.thepimp.net | http://www.libgd.org