Get_class -- returns the class name of the object
get_ Class ([ object $obj ] )
return to Like instance obj the name of the class to which it belongs. if obj is not an object then returns   false
<?php
classperson{
Public$username;
Public$age;
Public$height;
Public$weight;
Static Public= 0;
Publicfunction__construct ($username,$age,$height,$weight){
$this->username =$username;
$this->age =$age;
$this->height =$height;
$this->weight =$weight;
Self::++;
}
Publicfunction__set ($name,$value){
$this-$name=$value;
}
Public function__get ($name){
return$this-$name;
}
/**
* 1) Non-static members cannot be used directly in the static method because non-static members are related to the instance and are indirectly used by instantiation
* 2) This cannot be used in the static method (related to the instance)
* 3) Static members can be used in non-static methods
*/
Static PublicfunctionGetusernumber () {
Var_dump(Get_called_class ());
returnSelf::;
}
PublicfunctionGetUserName () {
Var_dump(Get_called_class ());
return$this->username;
}
Publicfunction__tostring () {
return‘‘;
}
}
$p=NewPerson (' Wangfei ', 36,165,52);
EchoGet_class($p);
?>
get_class--returns the class name of the object