In php I have a ROOT class from which all other classes inherit.
abstract class ROOT{
public static function getClass(){
}
}
I want that function to return the class(name) of the object which inherits from this class. So if I create an object Tree (extends ROOT) and call getClass on it it should say "Tree"
The function get_class() only works on objects, so can't be used inside a static function. Is there any way to accomplish this?