Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56671 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73435 invoked from network); 30 Nov 2011 01:22:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Nov 2011 01:22:50 -0000 Authentication-Results: pb1.pair.com smtp.mail=devis@oracolo.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=devis@oracolo.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain oracolo.com designates 209.85.215.42 as permitted sender) X-PHP-List-Original-Sender: devis@oracolo.com X-Host-Fingerprint: 209.85.215.42 mail-lpp01m010-f42.google.com Received: from [209.85.215.42] ([209.85.215.42:51012] helo=mail-lpp01m010-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 23/80-04068-96585DE4 for ; Tue, 29 Nov 2011 20:22:50 -0500 Received: by lami14 with SMTP id i14so19124lam.29 for ; Tue, 29 Nov 2011 17:22:46 -0800 (PST) Received: by 10.152.132.72 with SMTP id os8mr33420769lab.4.1322616166110; Tue, 29 Nov 2011 17:22:46 -0800 (PST) MIME-Version: 1.0 Sender: devis@oracolo.com Received: by 10.152.21.40 with HTTP; Tue, 29 Nov 2011 17:22:05 -0800 (PST) In-Reply-To: <4ED57E77.4080205@lerdorf.com> References: <4ED57E77.4080205@lerdorf.com> Date: Wed, 30 Nov 2011 01:22:05 +0000 X-Google-Sender-Auth: TGNmOluiZBWDLMn0w71W8_UHwyg Message-ID: To: Rasmus Lerdorf Cc: PHP internals Content-Type: multipart/alternative; boundary=f46d04308560c1571d04b2e9920e Subject: Re: [PHP-DEV] New dereferencing syntaxes in 5.4 From: devis@lucato.it --f46d04308560c1571d04b2e9920e Content-Type: text/plain; charset=UTF-8 Hi Rasmus, I already tested a similar example (see http://codepad.viper-7.com/tNkTTX) but I'm getting > *Parse error*: syntax error, unexpected '->' (T_OBJECT_OPERATOR) so my question... I thought this feature was part of 5.4 considering the previous messages, perhaps it is not. Devis On 30 November 2011 00:53, Rasmus Lerdorf wrote: > On 11/29/2011 04:49 PM, devis@lucato.it wrote: > > Hi, > > > > is the new dereferencing syntax definitely part of 5.4 ? > > > > Will it be possible to replace this: > > > > $model = new DomainModel('foo', 'bar'); > > $result = $model->findByName('John'); > > > > with: > > > > $result = (new DomainModel('foo', 'bar'))->findByName('John'); > > > > ? > > Why don't you try it? Download the latest RC from qa.php.net > ./configure && make && make test (and send us the results) > and then you can test your code snippet. > > -Rasmus > > > --f46d04308560c1571d04b2e9920e--