public static function from_json(&$data) { $class = get_called_class(); $obj = new $class(); $obj->set_from_json($data); return $obj; }