Re: New dereferencing syntaxes in 5.4
| From: | Rasmus Lerdorf | Date: | Wed, 30 Nov 2011 01:55:27 +0000 |
| Subject: | Re: New dereferencing syntaxes in 5.4 | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-56673@lists.php.net to get a copy of this message | ||
On 11/29/2011 05:22 PM, devis@lucato.it wrote:
> Hi Rasmus,
>
> I already tested a similar example (see
> http://codepad.viper-7.com/tNkTTX) but I'm getting
Sorry, pasting something into codepad doesn't qualify as testing. You
have no idea how and when they built the 5.4 they are running. Until the
first release, 5.4 is a moving target. And everyone who posts to
internals are expected to be able to download and install 5.4 on their own.
But to answer your question, yes, that syntax will work fine. It is
right out of the UPGRADING file at:
http://svn.php.net/viewvc/php/php-src/branches/PHP_5_4/UPGRADING?view=markup
which says:
- Class member access on instantiation:
(new foo)->method()
(new foo)->property
(new foo)[0]
-Rasmus