PHP无法在初始化程序中解析非平凡的表达式。
我更喜欢通过在类定义之后添加代码来解决此问题:
class Foo { static $bar;}Foo::$bar = array(…);要么
class Foo { private static $bar; static function init() { self::$bar = array(…); }}Foo::init();PHP 5.6现在可以处理一些表达式。
abstract class Foo{ private static function bar(){ static $bar = null; if ($bar == null) bar = array(...); return $bar; } self::bar();}


