jsonError = null; if (json_last_error_msg() != "No error") { $this->jsonLastError = json_last_error_msg(); } return $json; } /** * @param string $string * @return mixed */ public function unserialize($string) { $data = json_decode($string, true); $this->jsonError = null; if (json_last_error_msg() != "No error") { $this->jsonLastError = json_last_error_msg(); } return $data; } }