<?php // 简单获得一个类对应的反射信息 class demo{ CONST CON_STR = '123456'; public $str_1; private $str_2; protected $str_3; public function test(){ } } # 系统内置的class,用于产生一个镜像 $class = new ReflectionClass("demo"); echo '<pre>'; # 系统内置的class,用于导出镜像能反射的信息 Reflection::export($class); echo '<pre/>'; /*** 通常会打印出以下6种类型的信息: 1)常量 Contants 2)属性 Property Names 3)方法 Method Names静态 4)属性 Static Properties 5)命名空间 Namespace 6)Person类是否为final或者abstract */ ?>
http://www.dianyuan.com/people/788667
http://www.dianyuan.com/people/788668
http://www.dianyuan.com/people/788669
http://www.dianyuan.com/people/788670
http://www.dianyuan.com/people/788671
http://www.dianyuan.com/people/788672
http://www.dianyuan.com/people/788673
http://www.dianyuan.com/people/788674
http://www.dianyuan.com/people/788675