<?php class A { public static function F() { return "A"; } } $c = (function() { var_dump(static::F()); })->bindTo(new A, NULL); var_dump((new \ReflectionFunction($c))->getClosureScopeClass()->name); $c(); $c = (function() { var_dump(self::F()); })->bindTo(new A, "A"); var_dump((new \ReflectionFunction($c))->getClosureScopeClass()->name); $c(); $c = (function() { var_dump(self::F()); })->bindTo(new A, NULL); var_dump((new \ReflectionFunction($c))->getClosureScopeClass()->name); $c();
You have javascript disabled. You will not be able to edit any code.