function someStaticMethod() { $a->test;
public function __getWhy is $a->test (inside someStaticMethod()) not being overloaded by __get ??这些神奇的方法不会在静态上下文中触发。因此,这些方法不应被声明为静态的。从PHP5.3.0开始,如果
我的问题是:我需要为类中的静态变量重载标准get和set…但是php没有提供这样的功能...它是在2008年提出的,但仍然没有实现……只读的情况也是如此。我的问题是:有没有一种方法可以让静态属性可以从外部读取,但又不会被修改?= '666'; //<--- throws an error because variable is protected from modification
我不能使用const,因为一些变量包含数组也许有一些变通的<