Candidates = []; foreach ($param["Candidates"] as $key => $value){ $obj = new Candidate(); $obj->deserialize($value); array_push($this->Candidates, $obj); } } if (array_key_exists("FaceRect",$param) and $param["FaceRect"] !== null) { $this->FaceRect = new FaceRect(); $this->FaceRect->deserialize($param["FaceRect"]); } if (array_key_exists("RetCode",$param) and $param["RetCode"] !== null) { $this->RetCode = $param["RetCode"]; } } }