public function __construct($json) { $util = InstanceHolder::util(); if ($util->is_json($json)) { $std = json_decode($json); parent::__construct($std); $this->json_error = json_last_error(); $this->json_error_msg = json_last_error_msg(); } else { $std = new \stdClass(); parent::__construct($std); } }