Please tell me I’m missing something obvious here.
I am getting a syntax error for the code:
private $crlf = chr(13).chr(10);
It’s complaining about unfinished class declarations and an unexpected (.
I assumed this may be due to it being a function call (do the return values resolve at compile time?) after reading through http://www.php.net/manual/en/language.oop5.properties.php.
But then I notice in example 1 on the above link the line
public $var4 = self::myStaticMethod();
Which still generates syntax errors for because if the bracket.
Is this just an Aptana issue? If so, can anyone point me toward modifying the error highlighting in Aptana v2.0.5?
This is not a mistake by Aptana Studio; it’s really a syntax error in PHP. Indeed, when declaring class members, you can’t assign the return values of function or method calls to them, because function calls cannot be evaluated at compile time.
If you try to run your script in a browser, PHP will spit a parse error as well.