Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50607 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76874 invoked from network); 26 Nov 2010 21:54:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Nov 2010 21:54:35 -0000 Authentication-Results: pb1.pair.com smtp.mail=mike@rile.ca; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=mike@rile.ca; sender-id=unknown Received-SPF: error (pb1.pair.com: domain rile.ca from 216.221.81.28 cause and error) X-PHP-List-Original-Sender: mike@rile.ca X-Host-Fingerprint: 216.221.81.28 smtp1.cogeco.ca Received: from [216.221.81.28] ([216.221.81.28:35311] helo=fipsb03.cogeco.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6D/C1-00463-99C20FC4 for ; Fri, 26 Nov 2010 16:54:34 -0500 X-IronPort-AV: E=Sophos;i="4.59,262,1288584000"; d="scan'208";a="204950467" Received: from s72-38-93-190.static.comm.cgocable.net (HELO MikePC) ([72.38.93.190]) by fipsb03.cogeco.net with ESMTP; 26 Nov 2010 16:54:28 -0500 To: "'Felipe Pena'" , "'internals'" References: In-Reply-To: Date: Fri, 26 Nov 2010 16:53:10 -0500 Message-ID: <000f01cb8db4$53393980$f9abac80$@ca> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcuNoV0Ebl8Vjqt1QgCPnWU5kfUC9AAEpkFw Content-Language: en-ca Subject: RE: [PHP-DEV] [RFC] new foo()->bar() From: mike@rile.ca ("Mike Robinson") November-26-10 2:36 PM, Felipe Pena writes: > Hi all, > I'm here again to presents another proposal, which adds support for > instantiating a class and calling its methods and accessing its > properties on same command. > > Example: > > > class bar { > public $x = 'PHP'; > } > > class foo extends bar { > public function bar() { > return $this; > } > } > > 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? Nice. I have use for this. Some readability issues may arise but nothing that can't be overcome with some common sense. Best Regards, Mike Robinson