On Sat, Dec 8, 2012 at 5:36 PM, Steve Clay <st...@mrclay.org> wrote:

> On 12/8/12 4:48 PM, Adam Jon Richardson wrote:
>
>> call closures that are stored as object properties directly without having
>> to make use of a temporary variable.
>>
> ...
>
>  $o = new stdClass();
>> $o->func = function(){
>>      return 'Yes!';
>> };
>> $o->func();
>>
>
> The following expression avoids PHP's dilemma of distinguishing
> prop/method, but fails because you can't execute an expression:
>
> ($o->func)();
>

I actually tried that very technique before remembering the limitation :)

Interesting idea.

Adam

Reply via email to