Re: function call chaining
| From: | Alexey Zakhlestin | Date: | Tue, 19 Jan 2010 10:55:32 +0000 |
| Subject: | Re: function call chaining | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-46798@lists.php.net to get a copy of this message | ||
On 19.01.2010, at 13:47, Christian Schneider wrote:
> Alexey Zakhlestin wrote:
>> Would be nice if something like this worked too:
>> (new Class())->method();
>
> If you *really* want to do this you can use a factory method:
> Class::create()->method();
I know. That's what I do if I need it.
Or just create temporary variable
But, still, I want consistent syntax, which doesn't put limitations on me
this construct is an example of things, which many people take for granted and are shocked, when
they discover, that they can't use it.
I saw a lot of questions on forums regarding it