http://php.net/manual/en/language.oop5.properties.php shows the following example which fails for me.
class SimpleClass{
private $var3 = 1+2;
}
Parse error: syntax error, unexpected '+', expecting ',' or ';'....
Any ideas why?
php version 5.4.9
The documentation never states that it is a valid property declaration. It specifically states its an invalid example.
directly from your link
this is just how the language syntax is defined for PHP.