Re: sytax error, but where?
- From: "Janwillem Borleffs" <jw@xxxxxxxxxxxxx>
- Date: Sun, 30 Oct 2005 12:19:22 +0100
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
.
- Follow-Ups:
- Re: sytax error, but where?
- From: carlton
- Re: sytax error, but where?
- References:
- sytax error, but where?
- From: carlton
- Re: sytax error, but where?
- From: Oli Filth
- Re: sytax error, but where?
- From: carlton
- sytax error, but where?
- Prev by Date: Re: Class newbie - why doesn't this work?
- Next by Date: Re: sytax error, but where?
- Previous by thread: Re: sytax error, but where?
- Next by thread: Re: sytax error, but where?
- Index(es):
Relevant Pages
|