<?php class foo { public static function bar() { } public function getStaticClosure() { return static function() {}; } public function getClosure() { return function() { var_dump($this); }; } } $foo = new foo; $reflectionInstance = new ReflectionFunction($foo->getClosure()); var_dump($reflectionInstance->getClosureThis()); $reflectionStatic = new ReflectionFunction($foo->getStaticClosure()); var_dump($reflectionStatic->getClosureThis());
You have javascript disabled. You will not be able to edit any code.