Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:48686 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4859 invoked from network); 8 Jun 2010 13:09:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Jun 2010 13:09:28 -0000 Authentication-Results: pb1.pair.com smtp.mail=jacob@oettinger.dk; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=jacob@oettinger.dk; sender-id=unknown Received-SPF: error (pb1.pair.com: domain oettinger.dk from 209.85.161.42 cause and error) X-PHP-List-Original-Sender: jacob@oettinger.dk X-Host-Fingerprint: 209.85.161.42 mail-fx0-f42.google.com Received: from [209.85.161.42] ([209.85.161.42:48314] helo=mail-fx0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E6/14-13782-5014E0C4 for ; Tue, 08 Jun 2010 09:09:28 -0400 Received: by fxm5 with SMTP id 5so772120fxm.29 for ; Tue, 08 Jun 2010 06:09:21 -0700 (PDT) Received: by 10.103.87.36 with SMTP id p36mr5476030mul.102.1276002560954; Tue, 08 Jun 2010 06:09:20 -0700 (PDT) Received: from [10.0.1.6] (1307ds1-noe.0.fullrate.dk [90.184.9.39]) by mx.google.com with ESMTPS id e9sm7484827muf.10.2010.06.08.06.09.18 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 08 Jun 2010 06:09:19 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=iso-8859-1 In-Reply-To: <1275993681.2243.10.camel@guybrush> Date: Tue, 8 Jun 2010 15:09:16 +0200 Cc: Felipe Pena , internals Content-Transfer-Encoding: quoted-printable Message-ID: References: <2C70277E-0442-49B8-AD0B-E9F12ED7B42C@oettinger.dk> <1275993681.2243.10.camel@guybrush> To: =?iso-8859-1?Q?Johannes_Schl=FCter?= X-Mailer: Apple Mail (2.1078) Subject: Re: [PHP-DEV] [RFC] Array Dereferencing From: jacob@oettinger.dk (Jacob Oettinger) On 08/06/2010, at 12.41, Johannes Schl=FCter wrote: > On Tue, 2010-06-08 at 12:23 +0200, Jacob Oettinger wrote: >> Would it be equally simple to allow the syntax below? >>=20 >> $result =3D new ResultMaker()->getIt(); >=20 > does this mean=20 >=20 > $result =3D new (ResultMaker()->getIt()); >=20 > or >=20 > $result =3D (new ResultMaker())->getIt(); >=20 > I assume the later, but that is non-obvious as we allow >=20 > $result =3D new $class(); Yes the later. I do not see how the above makes it non-obvious.=20 As I see it the new operator will always instantiate the class name that = comes after it. The name can be given as either a literal class name, or = as a string variable or as a string variable in an array. It can not be = given as a function or method that returns a string. Regardless, it was the direct calling of a function (or invokable) = returned from a function I think was a good idea for consistency. Jacob