Re: Re: function call chaining
| From: | Johannes Schlüter | Date: | Tue, 19 Jan 2010 12:01:26 +0000 |
| Subject: | Re: Re: function call chaining | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-46803@lists.php.net to get a copy of this message | ||
Hi,
On Tue, 2010-01-19 at 12:31 +0100, Michael Wallner wrote:
> On 01/19/2010 01:27 AM, Stanislav Malyshev wrote:
> > Hi!
> >
> > I wrote a small patch that enables this kind of syntax in PHP:
> >
> > foo()();
I think that becomes hard to read quite easily.
> I'd rather see two other things that are missing, support for
> dynamic object and array de-referencing like
> (new class)->method() and get_array()["index"].
For the latter - there's a patch by some user in the bug tracker, which
I can't find right now.
Having $foo[0]->bar(); and $foo()[0]; it might also make sense to allow
more of these, like the proposed foo()() but other than such consistency
I don't really like it ....
johannes