Re: Suggestion: echo function(var)[0];
| From: | Jille Timmermans | Date: | Sun, 06 Jun 2010 20:10:04 +0000 |
| Subject: | Re: Suggestion: echo function(var)[0]; | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-48667@lists.php.net to get a copy of this message | ||
Felipe Pena schreef:
> 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 ?
>
If the patch is really that easy I'm gonna kill someone. (Or marry you,
depending on my mood :))