public static function encode($value, $options = 0) { $json = json_encode($value, $options); self::checkError(); return $json; }