get_object_vars — 返回由对象属性组成的关联数组
array get_object_vars ( object $obj )
get_class_vars — 返回由类的默认属性组成的数组
array get_class_vars ( string $class_name )
$class_methods = get_class_methods(new myclass());
foreach ($class_methods as $method_name) {
echo "$method_name
";
}
// create an object
$bar = new foo();
// external call
echo "Its name is " , get_class($bar) , "
";
// internal call
$bar->name();
?>
Its name is foo