您好,欢迎来到码863代码分享网! 请[登录] / [注册]

PHP查看类的结构定义

编辑

class T{
    const DDD="ddd";
    static $bbb="bbb";
    
    private $aa = 'aaa';
    protected $bb = 'bbb';
    public $cc = 'ccc';
    
    
    private function __set($name , $value){
        //$this->$name = $value;
    }
    private function __get($name){
        //return $this->$name;
    }
}
T::DDD;
T::$bbb;
$oa = new T();

$oa->aa="This is aa .";
$oa->ccccc="This is ccccccccc .";

Reflection::export(new ReflectionClass('T'));

结果如下:

Class [ <user> class T ] {   @@ D:\xampp\htdocs\atest\test.php 18-33    - Constants [1] {     Constant [ string DDD ] { ddd }   }
CopyRight 2002~2023 精通2100网 联系邮箱:qqtxt@163.com
版权所有:精通2100网 湘ICP备2023018646号-1
MYSQl共执行 3 个查询,用时 0.0018799304962158 秒,PHP脚本用时 0.003848 秒,占用内存 0.594 MB,Gzip 已启用