(PHP 5 >= 5.3.0)
get_called_class — the "Late Static Binding" class name
Gets the name of the class the static method is called in.
Returns the class name. Returns FALSE if called from outside a class.
Пример #1 Using get_called_class()
<?phpclass foo { static public function test() { var_dump(get_called_class()); }}class bar extends foo {}foo::test();bar::test();?>
Результат выполнения данного примера:
string(3) "foo" string(3) "bar"