PHP - 定义对象的静态数组
你能在PHP的类中初始化一个静态对象数组吗?就像你可以做的
class myclass {
public static $blah = array("test1", "test2", "test3");
}
但是当我这样做时
class myclass {
public static $blah2 = array(
&new myotherclass(),
&new myotherclass(),
&new myotherclass()
);
}
其中 myother 类定义在 my 类的正上方。然而,这会产生一个错误;有没有办法实现它?