This question already has an answer here:
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();
?>
http://php.net/manual/en/function.get-called-class.php
As of PHP 5.3, there is
get_called_class()
for this purpose: