<?php //获得多个类对应的反射信息 class demo{ public $str_1; private $str_2; protected $str_3; public function test(){ } } class demo2{ public $res_1; private $res_2; protected $res_3; private function test(){ } } # get_declared_classes() 获得当前所有类的名称 foreach(get_declared_classes() as $class){ $myclass = new ReflectionClass($class); # isUserDefined 检测这个类是否用户自定义的 if($myclass->isUserDefined()){ echo '<pre>'; Reflection::export($myclass); echo '<pre/>'; } } ?>