diff options
Diffstat (limited to 'ext/json/json_encoder.c')
-rw-r--r-- | ext/json/json_encoder.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/json/json_encoder.c b/ext/json/json_encoder.c index 92ab413cf0..cf9d9adaa2 100644 --- a/ext/json/json_encoder.c +++ b/ext/json/json_encoder.c @@ -104,10 +104,10 @@ static inline void php_json_encode_double(smart_str *buf, double d, int options) { size_t len; char num[PHP_JSON_DOUBLE_MAX_LENGTH]; - if (PG(serialize_precision) == -1) { + if (JSON_G(precision) == -1) { php_0cvt(d, 17, '.', 'e', num); } else { - php_gcvt(d, PG(serialize_precision), '.', 'e', num); + php_gcvt(d, JSON_G(precision), '.', 'e', num); } len = strlen(num); if (options & PHP_JSON_PRESERVE_ZERO_FRACTION && strchr(num, '.') == NULL && len < PHP_JSON_DOUBLE_MAX_LENGTH - 2) { |