044-PHP获得多个类对应的反射信息
作者:互联网
<?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/>'; } } ?>
标签:反射,044,Reflection,isUserDefined,echo,export,myclass,PHP 来源: https://www.cnblogs.com/tianpan2019/p/10994154.html