Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50595 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54171 invoked from network); 26 Nov 2010 20:21:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Nov 2010 20:21:59 -0000 Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 217.114.211.66 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 217.114.211.66 unknown Solaris 10 (beta) Received: from [217.114.211.66] ([217.114.211.66:50039] helo=config.schlueters.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FB/10-52610-BD610FC4 for ; Fri, 26 Nov 2010 15:21:48 -0500 Received: from [192.168.1.29] (ppp-93-104-60-225.dynamic.mnet-online.de [93.104.60.225]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by config.schlueters.de (Postfix) with ESMTPSA id D9EA146AB7; Fri, 26 Nov 2010 21:21:44 +0100 (CET) To: Felipe Pena Cc: internals In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Date: Fri, 26 Nov 2010 21:21:43 +0100 Message-ID: <1290802903.7033.772.camel@guybrush> Mime-Version: 1.0 X-Mailer: Evolution 2.30.2 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] new foo()->bar() From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) On Fri, 2010-11-26 at 17:36 -0200, Felipe Pena wrote: > var_dump(new foo()->bar()->x); // string(3) "PHP" It has some readability issues. One might assume it is new (foo()->bar()->x) not (new foo())->bar()->x As there is a mandatory space between "new" and its operand and no space in front of the object operator and we allow non-constant operands to "new". So what is new $bar->foo(); ? If I read the patch correctly this is valid and evaluated as (new $bar)->foo(); johannes