taskcards = new \stdClass(); //$this->achieveDic = new \stdClass(); $day7List = GameConfig::activeTask_type_getItemArray(Enum_ActiveTaskType::WeekTask); $length = $this->activeTaskLength; foreach ($day7List as $key => $task) { $length += 1; $ins_TaskStep_Active = new Ins_TaskStep_Active($task->id); $ins_TaskStep_Active->uid = $length; $ins_TaskStep_Active->state = Enum_TaskCardStateType::ing; $this->activeTaskInfo->$length = $ins_TaskStep_Active; } $this->activeTaskLength = $length; } public function __construct($arg = null) { if ($arg == null) { $this->taskcards = new \stdClass(); $this->achieveDic = new \stdClass(); $this->activeTaskInfo = new \stdClass(); } else { parent::__construct($arg); } } }