get_called_class() in closure-scopes:
<?PHP
ABSTRACT CLASS Base
{
protected static $stub = ['baz'];
static public function boot()
{
print __METHOD__.'-> '.get_called_class().PHP_EOL;
array_walk(static::$stub, function()
{
print __METHOD__.'-> '.get_called_class().PHP_EOL;
});
}
public function __construct()
{
self::boot();
print __METHOD__.'-> '.get_called_class().PHP_EOL;
array_walk(static::$stub, function()
{
print __METHOD__.'-> '.get_called_class().PHP_EOL;
});
}
}
CLASS Sub EXTENDS Base
{
}
Base::boot(); print PHP_EOL;
Sub::boot(); print PHP_EOL;
new sub;
new sub;
?>