<?php
function printCalledClass()
{
echo(get_called_class() . "\n");
}
abstract class Foo
{
public static function printMe()
{
printCalledClass();
}
}
class Bar extends Foo
{
}
Bar::printMe();
Fatal error: Uncaught Error: get_called_class() must be called from within a class in /in/6G0MT:4
Stack trace:
#0 /in/6G0MT(11): printCalledClass()
#1 /in/6G0MT(19): Foo::printMe()
#2 {main}
thrown in /in/6G0MT on line 4
Process exited with code 255.