note 113054 deleted from language.oop5.properties by nikic
| From: | nikic@php.net | Date: | Tue, 27 Sep 2016 13:54:42 +0000 |
| Subject: | note 113054 deleted from language.oop5.properties by nikic | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-206682@lists.php.net to get a copy of this message | ||
Note Submitter: singhkumardinesh at gmail dot com
----
if you run this below program it will through the error. but in the example related we have shown
that it is possible.
class example {
public $public = self::getStaticFunction();
static function getStaticFunction(){
return 1+1;
}
}
$obj = new example();
echo $obj->public;
ERROR:
( ! ) Parse error: syntax error, unexpected '(', expecting ',' or ';'
in C:\wamp\www\php\class.php on line 3