Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我收到如下错误:
Parse error: syntax error, unexpected '(', expecting ',' or ';' in X:\xampp\htdocs\lib.php on line 15
当我尝试将日期保存到变量时。这是我的代码...(PHP)
protected $title = date('D, d M Y');
您应该在构造函数中设置属性默认值:
class Something { protected $title; public function __construct() { $this->title = date('D, d M Y'); } }