Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50593 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48645 invoked from network); 26 Nov 2010 19:52:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Nov 2010 19:52:00 -0000 Authentication-Results: pb1.pair.com smtp.mail=ilia@prohost.org; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ilia@prohost.org; sender-id=pass Received-SPF: pass (pb1.pair.com: domain prohost.org designates 209.85.161.42 as permitted sender) X-PHP-List-Original-Sender: ilia@prohost.org X-Host-Fingerprint: 209.85.161.42 mail-fx0-f42.google.com Received: from [209.85.161.42] ([209.85.161.42:55900] helo=mail-fx0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 81/BD-61791-FDF00FC4 for ; Fri, 26 Nov 2010 14:51:59 -0500 Received: by fxm11 with SMTP id 11so1859022fxm.29 for ; Fri, 26 Nov 2010 11:51:56 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.79.13 with SMTP id n13mr2496969fak.139.1290801115623; Fri, 26 Nov 2010 11:51:55 -0800 (PST) Received: by 10.223.20.20 with HTTP; Fri, 26 Nov 2010 11:51:55 -0800 (PST) In-Reply-To: References: Date: Fri, 26 Nov 2010 14:51:55 -0500 Message-ID: To: Felipe Pena Cc: internals Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] new foo()->bar() From: ilia@prohost.org (Ilia Alshanetsky) +1 Seems like a handy change and the patch is quite manageable. On Fri, Nov 26, 2010 at 2:36 PM, Felipe Pena wrote: > Hi all, > I'm here again to presents another proposal, which adds support for > instantiating a class and calling its methods and accessing its propertie= s > on same command. > > Example: > > > class bar { > =A0public $x =3D 'PHP'; > } > > class foo extends bar { > =A0public function bar() { > =A0 =A0return $this; > =A0} > } > > var_dump(new foo()->bar()->x); // string(3) "PHP" > > ?> > > Other examples which describes the feature at > http://wiki.php.net/rfc/instance-method-call > > Thoughts? > > -- > Regards, > Felipe Pena >