I'm getting this error:
Parse error: syntax error, unexpected '.', expecting ',' or ';' in /var/(...)/config.php on line 5
With this (simplified) code:
<?php
class Config
{
public static $somevar = "Date: " . date('Y');
}
?>
I thought this was valid php, but I guess not... what am I doing wrong here? Thanks!
According to the PHP docs:
Try writing
after the class definition.
No operation or function is allow for property initialization, because this is evaluated when parsing.
From Manual