dis-bench / src /php /php-src /ext /json /tests /bug40503.phpt
meddyrat's picture
Replace repository contents with the original corrected artifact
1e94262
Raw History Blame Contribute Delete
439 Bytes
--TEST--
Bug #40503 (json_encode() value corruption on 32bit systems with overflown values)
--INI--
serialize_precision=-1
--FILE--
<?php
function json_test_show_eq($x, $y) {
echo "$x ". ( $x == $y ? "==" : "!=") ." $y\n";
}
$value = 0x7FFFFFFF; #2147483647;
json_test_show_eq("$value", json_encode($value));
$value++;
json_test_show_eq("$value", json_encode($value));
?>
--EXPECT--
2147483647 == 2147483647
2147483648 == 2147483648