Re: Suggestion: echo function(var)[0];
| From: | Felipe Pena | Date: | Sat, 05 Jun 2010 19:28:44 +0000 |
| Subject: | Re: Suggestion: echo function(var)[0]; | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-48661@lists.php.net to get a copy of this message | ||
Hi!
2010/6/4 Stas Malyshev <smalyshev@sugarcrm.com>
> Hi!
>
>
> function call chaining (f()() if f() returns function), and array
>> dereferencing (f()[0]) - (Stas)
>>
>
> I did patch for f()() - it's referenced at
> http://wiki.php.net/rfc/fcallfcall - but not for f()[] -
> didn't have time
> for that yet.
>
> It should not be too hard to do, one just has to be careful with refcounts
> so that the returned result could be freed properly and without hurting the
> referred element.
>
I wrote a patch, but I cannot test all cases, so I'm not sure if is okay at
all.
What about this approach: http://felipe.ath.cx/diff/array_dereference.diff
?
--
Regards,
Felipe Pena