News for hackers. Stuff that matters.
Re:Closure Object Binding in PHP 5.4 by deweller on Wednesday October 26, 2011 @11:40AM (#3159020)
You can use this:

    call_user_func($context->closure);
But yeah, some syntactic sugar would sure be nice. I'd like to see this in a future version of PHP...

   ($context->closure)();
Re:Closure Object Binding in PHP 5.4 by mgkimsal on Wednesday October 26, 2011 @11:50AM (#3159069)
It doesn't even have to be 'sugar' like that.

$content->closure()

It could look at the registered methods, then scan for properties of that name that would be closures, then fall back to __call. You could add this to __call with __set() checks for assigned values being closures, but it's rather ugly to have to do that for all class definitions.