有人可以告诉我我做错了什么。想要用一些带有默认值的私有变量声明我的类,但是在声明$ current_week_day时我出现语法错误,并且每次尝试声明名称'和' date'属性。
class Catwz_Shortcode{
private $add_script=false;
private $current_week_day=date('w')==0 ? 7 : date('w');
private $week_days=array(
'1'=>array(
'name'=>__('Monday', 'codeaddict-task'),
'date'=>date('Y-m-d',time()+(1-$this->current_week_day)*24*3600),
),
'2'=>array(
'name'=>__('Tuesday', 'codeaddict-task'),
'date'=>date('Y-m-d',time()+(2-$this->current_week_day)*24*3600),
),
'3'=>array(
'name'=>__('Wednesday', 'codeaddict-task'),
'date'=>date('Y-m-d',time()+(3-$this->current_week_day)*24*3600),
),
'4'=>array(
'name'=>__('Thursday', 'codeaddict-task'),
'date'=>date('Y-m-d',time()+(4-$this->current_week_day)*24*3600),
),
'5'=>array(
'name'=>__('Friday', 'codeaddict-task'),
'date'=>date('Y-m-d',time()+(5-$this->current_week_day)*24*3600),
),
'6'=>array(
'name'=>__('Saturday', 'codeaddict-task'),
'date'=>date('Y-m-d',time()+(6-$this->current_week_day)*24*3600),
),
'7'=>array(
'name'=>__('Sunday', 'codeaddict-task'),
'date'=>date('Y-m-d',time()+(7-$this->current_week_day)*24*3600),
),
);
}