I'm currently developing a web-based administration frontend, for an application I developed, in PHP (after several failed attempts to get Lua working with Apache and Nginx being a little weird, too) and PHP's arrays are frustrating me.
I'm trying to initialize an array of objects as I would in any other OOP-capable language:
private $leftNavItems = array(
new LeftNavItem("./img/icon/status.png", "status", "App Status", "./articles/app_status.phtml", "app_status")
);
however, I'm getting an error stating "expression not allowed as field default value".
Why can I not initialize an array with new objects? Would I have to work around this by using temporary variables and array_push?
EDIT : I'm coming from OOP languages such as C#, Java and C++, as well as pure procedural languages such as Lua.