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\n";
}

 

 

// create an object
$bar = new foo();

// external call
echo "Its name is " get_class($bar) , "\n";

// internal call
$bar->name();

?>

 

Its name is foo

相关文章:

  • 2021-08-06
  • 2022-12-23
  • 2021-09-22
  • 2022-12-23
  • 2021-11-30
猜你喜欢
  • 2021-04-16
  • 2021-12-26
  • 2021-12-16
  • 2021-09-21
  • 2022-12-23
  • 2021-11-18
相关资源
相似解决方案