diff options
Diffstat (limited to 'ext/json/json.c')
| -rw-r--r-- | ext/json/json.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/json/json.c b/ext/json/json.c index 2077051279..8a942a8655 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -538,7 +538,6 @@ static void json_encode_serializable_object(smart_str *buf, zval *val, int optio PHP_JSON_API void php_json_encode(smart_str *buf, zval *val, int options TSRMLS_DC) /* {{{ */ { - JSON_G(error_code) = PHP_JSON_ERROR_NONE; switch (Z_TYPE_P(val)) { case IS_NULL: @@ -680,6 +679,8 @@ static PHP_FUNCTION(json_encode) return; } + JSON_G(error_code) = PHP_JSON_ERROR_NONE; + php_json_encode(&buf, parameter, options TSRMLS_CC); ZVAL_STRINGL(return_value, buf.c, buf.len, 1); |
