Re: sytax error, but where?



Oli Filth wrote:
carlton said the following on 29/10/2005 22:54:

41 class C_Category{
42 // var $name = array(); changed to var $catname="";
43    var $catname = "";   44    $PictureList[] = new C_PictureList();
45 }
the above code (line numbers added) gives the error message:-
Parse error: parse error, unexpected T_VARIABLE, expecting
T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /var/www/html/lc.php on
line 44
The class C_PictureList is defined prior to line 41


You need "var $PictureList[]...", or if PHP 5, then public, protected or private.


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();
.



Relevant Pages

  • Re: hpricot
    ... It just gave me "test.rb:1: parse error, ... tIDENTIFIER, expecting $"... ... Seven Deadly Sins? ...
    (comp.lang.ruby)
  • Re: PHP5 Dom XML dynamic Table Generation
    ... I keep getting the following output in my browser when attempting this. ... Parse error: syntax error, unexpected ';', expecting ']' in ...
    (alt.php)
  • Parse error showing with display_errors = off
    ... Parse error: syntax error, unexpected '{', expecting '(' in C:\Inetpub ... please forgive my ignorance. ...
    (php.general)
  • HELP PLZ: sessions and echo variables problem
    ... Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ... echo 'Sorry you do not have access to this page'; ... I am guessing that its the php code thats on ...
    (alt.php)
  • hpricot
    ... It just gave me "test.rb:1: parse error, ... tIDENTIFIER, expecting $"... ... I tried to copy that script and pasted it into my texteditor to just ... try to launch it but it gave me the: ...
    (comp.lang.ruby)