Get_class_vars -- returns an array that consists of the default properties of the class
get_ Class_vars ( string $class _name )
returns the default by the class Public Properties An associative array of elements of this array that varname = value the form exists.
<?php
classperson{
Public $username;
Public$age;
Public$height;
Public$weight;
Static Public$number= 0;
Publicfunction__construct ($username,$age,$height,$weight){
$this->username =$username;
$this->age =$age;
$this->height =$height;
$this->weight =$weight;
Self::$number++;
}
Publicfunction__set ($name,$value){
$this-$name=$value;
}
Publicfunction__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::$number;
}
PublicfunctionGetUserName () {
Var_dump(Get_called_class ());
return$this->username;
}
Publicfunction__tostring () {
return‘‘;
}
}
Var_dump(Get_class_vars(' person '));
?>
get_class_vars--returns an array that consists of the default properties of the class