Re: New dereferencing syntaxes in 5.4
| From: | devis at lucato dot it | Date: | Wed, 30 Nov 2011 01:22:05 +0000 |
| Subject: | Re: New dereferencing syntaxes in 5.4 | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-56671@lists.php.net to get a copy of this message | ||
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 <rasmus@lerdorf.com> 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
>
>
>