Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69349 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13753 invoked from network); 26 Sep 2013 10:38:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Sep 2013 10:38:50 -0000 Authentication-Results: pb1.pair.com header.from=linepogl@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=linepogl@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.180 as permitted sender) X-PHP-List-Original-Sender: linepogl@gmail.com X-Host-Fingerprint: 209.85.192.180 mail-pd0-f180.google.com Received: from [209.85.192.180] ([209.85.192.180:46545] helo=mail-pd0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BA/8C-46303-9BE04425 for ; Thu, 26 Sep 2013 06:38:50 -0400 Received: by mail-pd0-f180.google.com with SMTP id y10so967111pdj.25 for ; Thu, 26 Sep 2013 03:38:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=5MV4t8NIOsEXV7wkNrx+57R785T+aMudwbpyZoWMmQI=; b=EkIHYf3zNVIXNdWfM1I+2876/TrvRAoC+9JhC+KGboFJKvPzXHQeDkGOxS2ck/weA7 n0yKTf/uK+TnFhlItTe2NO/vpK8ek6BeOlTHVnlExFRKgpo8X29eHzqaSU2ARwJ7pDOq Nhpczt2Coeh8pSZa8YczclrdGkctQydQ/i2dcGA35w3bceyyTgmd977XKGEH4TaqIWVj RcGHQfolkbwSykNsCfpmOtxnTga/hv6kymsO2vOkW3Rc3ILvwT/x4ipURxBuKWo/TvuP lpLt7YZlpgXuGHRtQu477XYWEIXhcS2Y0QLZ1yPs/gG8qR54fR52PZFFid2u2cIkCM5q KHWw== X-Received: by 10.68.211.202 with SMTP id ne10mr262197pbc.168.1380191927203; Thu, 26 Sep 2013 03:38:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.70.3.163 with HTTP; Thu, 26 Sep 2013 03:38:27 -0700 (PDT) In-Reply-To: <5243F19F.3060307@php.net> References: <5243F19F.3060307@php.net> Date: Thu, 26 Sep 2013 12:38:27 +0200 Message-ID: To: Joe Watkins Cc: "internals@lists.php.net" , Pierre Joye Content-Type: multipart/alternative; boundary=e89a8ff1c43a8afdb004e746f961 Subject: Re: [PHP-DEV] RFC: Anonymous Classes From: linepogl@gmail.com (Lazare Inepologlou) --e89a8ff1c43a8afdb004e746f961 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2013/9/26 Joe Watkins > On 09/26/2013 01:50 AM, Pierre Joye wrote: > >> hi! >> >> On Sun, Sep 22, 2013 at 11:39 PM, Joe Watkins wrote: >> >>> Morning All, >>> >>> https://wiki.php.net/rfc/**anonymous_classes >>> >>> I'd like to hear thoughts regarding the addition of anonymous classes, >>> patch included. >>> >> >> Thanks for your proposal and work. >> >> If you did not yet update your RFC I would suggest to do so, it is about >> the right time. >> >> Adding already answered questions, more use cases (read a couple of good >> ones in this thread). It will help to end in circular discussions or >> arguing. >> >> Cheers, >> Pierre >> >> > Thanks ... > > I have made many changes to the RFC and patch since the beginning of this > discussion ... > > It might be useful if you could all now go back to the RFC for another > read, point out anything I've left unclear at this point. > > Thank you for the updates. There is a possible mistake in the "Inheritance" section. The $this->data array is passed by value to the constructor of the anonymous class. Once there is any change to the initial array, the two classes will contain different data. Which leads us to the point that this pattern is not enough to do what you wanted to without changing the original constructor. This is usually out of the question, as one such change will also change the outer class' behavior= . We don't have to reinvent the wheel here. The solution is some kind of "use" clause that works similarly to the anonymous functions. Cheers, Lazare INEPOLOGLOU Ing=C3=A9nieur Logiciel --e89a8ff1c43a8afdb004e746f961--