static function phpJsonEncode($val) { $json = json_encode(haxe_Json::convertBeforeEncode($val)); if ($json === false) { haxe_Json_0($json, $val); } else { return $json; } }
static function phpJsonEncode($val, $replacer = null, $space = null) { if (null !== $replacer || null !== $space) { return haxe_format_JsonPrinter::hprint($val, $replacer, $space); } $json = json_encode(haxe_Json::convertBeforeEncode($val)); if ($json === false) { throw new HException("invalid json"); } else { return $json; } }