I know that you can use get_class ($ this) normally, but I need to get the class name in a static function where the object was not created.
See the following code:
class ExampleClass
{
static function getClassName()
{
echo get_class($this);
}
}
$test1 = new ExampleClass();
$test1->getClassName();
ExampleClass::getClassName();
source
share