php print inherited class name
by Prakash[ Edit ] 2014-09-04 17:58:07
Is it possible in php to print inherited class name using a function in parent class ?
No it is not possible.
class Base {
public static function whoAmI() {
return get_called_class();
}
}
class User extends Base {}
print Base::whoAmI(); // prints "Base"
print User::whoAmI(); // prints "User"