如果我在PHP中有一个实例,那么最简单的方法是什么来访问该实例的静态属性('类变量')?
这个
$classvars=get_class_vars(get_class($thing));
$property=$classvars['property'];
听起来过于繁琐。我会期望
$thing::property
或。$thing->property
编辑:这是一个旧问题。在新版本的 PHP 中,有更明显的方法来实现这一点,请查看下面。