<?php
class A {
static function foo() {
echo static::class, ' in ', self::class, PHP_EOL;
}
}
class B extends A {}
B::foo();
$closure = (new ReflectionMethod('B', 'foo'))->getClosure(null)->bindTo(null, A::class);
$closure();
Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /in/lmLWk on line 5
Process exited with code 255.