当我做:
class MyClass {
public $copy = file_get_contents('somefile.mdown');
}
我得到:
PHP Parse error: syntax error, unexpected '(', expecting ',' or ';' \
in /file.php on line 25
我是 PHP 类的新手,但不是 OOP 的新手。
当然,我可以在课外做 file_get_contents ,一切都很好。这是怎么回事?