Get the name of a classes declaring variable from within the class / Get the name of the object's variable from within the object
Posted on 2007-08-07
Is it possible, from within a class, specifically the constructor, to get the name of the declaring variable?
AKA: I want to get the name of the object's variable.
$myClass = new Foo();
// making ths next line up, but you will get what I am trying to do.
echo $this->declaring_variable_name; // myClass;