关于输出类的对象数据

来源:互联网 发布:php 500错误 编辑:程序博客网 时间:2024/06/05 14:25

看下面的例子

输出结果为:

print_r:Test Object
(
    [test] => test
    [test3:private] => test3
    [test4] => test4
    [test5:protected] => test5
)

var_dump:object(Test)#1 (4) {
  ["test"]=>
  string(4) "test"
  ["test3:private"]=>
  string(5) "test3"
  ["test4"]=>
  string(5) "test4"
  ["test5:protected"]=>
  string(5) "test5"
}

 

可以看出 static 和 const 的都没有输出。

原创粉丝点击