Re: sytax error, but where?



carlton wrote:
> I added the var to line 44, and now get the error
> Parse error: parse error, unexpected '[', expecting ',' or ';' in
> /var/www/html/lc.php on line 44
>
> line 44 is var $PictureList[] = new C_PictureList();
>

You should assign $PictureList in the constructor or with a setter:

class C_Category {
var $PictureList = array();

function C_Category() {
$this->PictureList[] = new C_PictureList();
}
}


JW



.



Relevant Pages