$closure = function() {
echo $this->foo;
};
$context = new \StdClass;
$context->foo = "Hello World";
$context->closure = $closure;
$context->closure();
Not sure if this will be possible in 5.4, but haven't seen anything on it. Right now, we have to do
$context->closure = $closure;
$temp = $context->closure;
$temp();
which is kinda ugly.