I have this code in PHP:
abstract class Development
{
static function testUnit()
{
echo get_class();
}
}
class Component extends Development
{
}
But if I am calling Component::testUnit();
I am receiving Development instead of Component. It is puzzling me because such static function has no meaning I guess.
You want to use get_called_class instead ... http://php.net/manual/en/function.get-called-class.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With