I have a function that gets the class passed to it as a parameter. I would like to get the class name of the passed class as a string.
I tried to put this method in a passed class:
function getClassName()
{
return __CLASS__;
}
but if the class is extended, I assumed that it will return the name of the subclass, but it still returns the name of the superclass, which I find odd.
So, if the $ var variable is passed to the function as a parameter, is there a way to get the class name string?
Thank!!
source
share