Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50600 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63233 invoked from network); 26 Nov 2010 20:52:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Nov 2010 20:52:00 -0000 Authentication-Results: pb1.pair.com header.from=felipensp@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=felipensp@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: felipensp@gmail.com X-Host-Fingerprint: 209.85.214.42 mail-bw0-f42.google.com Received: from [209.85.214.42] ([209.85.214.42:56356] helo=mail-bw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E3/D1-52610-FED10FC4 for ; Fri, 26 Nov 2010 15:51:59 -0500 Received: by bwz13 with SMTP id 13so2220495bwz.29 for ; Fri, 26 Nov 2010 12:51:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type; bh=6IwqT9KVvQuTqSkX6b6zUhcJKCU+3sCqGNChTB/hSvs=; b=QwV6cjzr8PCO+Zf5iFsmY3fwuZ0lIs2MQf3C/rJq5NOlMhnQ1hqr259QJQyWYdQApC fYXbOSE+U67pOsqkPddyrEbteLR3VYNHn7HPGVdMSyKss09hCLUmPxEhxRQfIQVs+dJS sHWLjp7HY95dfujogeJWE9LUi/LmK02zlAdNM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=XfsNm6xl3VGgXzuLHD/fi2Hn9B9qLatzbtnSPqKWb9gJbYNiR+vzx43EGcwP6eMqAv iQNyhLvtW2ExLi3ugciKlhVv7egN11/hzxBKX7xiVjnRY8WVdzMKGmhzKtHwBG0neees WChtreJG4aZETxr5tndI3nyD0NlL3wlfIHqCM= Received: by 10.204.98.201 with SMTP id r9mr2307435bkn.2.1290804716244; Fri, 26 Nov 2010 12:51:56 -0800 (PST) MIME-Version: 1.0 Received: by 10.204.52.146 with HTTP; Fri, 26 Nov 2010 12:51:35 -0800 (PST) In-Reply-To: <1290802903.7033.772.camel@guybrush> References: <1290802903.7033.772.camel@guybrush> Date: Fri, 26 Nov 2010 18:51:35 -0200 Message-ID: To: =?UTF-8?Q?Johannes_Schl=C3=BCter?= Cc: internals Content-Type: multipart/alternative; boundary=001636499dfb960e060495fae457 Subject: Re: [PHP-DEV] [RFC] new foo()->bar() From: felipensp@gmail.com (Felipe Pena) --001636499dfb960e060495fae457 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2010/11/26 Johannes Schl=C3=BCter > 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 > > new foo()->bar() should be read as: (new foo())->bar(). And using variable: new $bar->y()->x should be read as: (new ($bar->y)())->x. y()->x); // 1 ?> I.e. just as it is nowdays. --=20 Regards, Felipe Pena --001636499dfb960e060495fae457--