PHP Получить имя дочернего класса в статической функции [дубликат]
This question already has an answer here:
Getting the name of a child class in the parent class (static context) 9 answers How can I get the classname from a static call in an extended PHP class? 6 answersВозможно ли что-то подобное?
<?
class A
{
public static function fun()
{
var_dump(get_class(child)); //bool(false) //should return B
}
}
class B extends A
{
public static function fun()
{
parent::fun();
}
}
B::fun();
?>