It would be better if we can assign return value of function to property.
If not at least we should generate a nice error message.
Currently when we try to assign return value of function to property we get
the following error:
Parse error: syntax error, unexpected '(', expecting ',' or ';' in
index.php on line 4
We should replace this error with the following error:
Fatal error: You must assign a static value to property in index.php on
line 4.
OR
Fatal error: Dynamic values cannot be assigned to property in index.php on
line 4.
It would be better if we can assign return value of function to property.
If not at least we should generate a nice error message.
Currently when we try to assign return value of function to property we get
the following error:
Parse error: syntax error, unexpected '(', expecting ',' or ';' in
index.php on line 4We should replace this error with the following error:
Fatal error: You must assign a static value to property in index.php on
line 4.
OR
Fatal error: Dynamic values cannot be assigned to property in index.php on
line 4.
Since PHP 7 the error message is:
Fatal error: Constant expression contains invalid operations
Nikita