Assign return value of function to property or replace parse error with nice fatal error
| From: | Khawer . | Date: | Mon, 11 Jul 2016 19:39:59 +0000 |
| Subject: | Assign return value of function to property or replace parse error with nice fatal error | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-94474@lists.php.net to get a copy of this message | ||
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.