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
Is something like this possible?
<?
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();
?>