diff --git a/ext/json/json_encoder.c b/ext/json/json_encoder.c index 0108367dc54..25f41d57f52 100644 --- a/ext/json/json_encoder.c +++ b/ext/json/json_encoder.c @@ -84,8 +84,7 @@ static inline void php_json_encode_double(smart_str *buf, double d, int options) php_gcvt(d, (int)PG(serialize_precision), '.', 'e', num); len = strlen(num); - if ((options & PHP_JSON_PRESERVE_ZERO_FRACTION && strchr(num, '.') == NULL && len < PHP_DOUBLE_MAX_LENGTH - 2) - || (UNEXPECTED(len == 2 && num[0] == '-' && num[1] == '0'))) { + if (options & PHP_JSON_PRESERVE_ZERO_FRACTION && strchr(num, '.') == NULL && len < PHP_DOUBLE_MAX_LENGTH - 2) { num[len++] = '.'; num[len++] = '0'; num[len] = '\0'; diff --git a/ext/json/tests/bug79908.phpt b/ext/json/tests/bug79908.phpt deleted file mode 100644 index b2aea31069a..00000000000 --- a/ext/json/tests/bug79908.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Bug #79908 (json_encode encodes negative zero as int) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -string(4) "-0.0"