php-src/Zend/tests/zend_strtod.phpt
Nikita Popov a939805641 Use serialize_precision for var_dump()
var_dump() is debugging functionality, so it should print
floating-point numbers accurately. We do this by switching
to serialize_precision, which (by default) will print with
as much precision as necessary to preserve the exact value
of the float.

This also affects debug_zval_dump().

Closes GH-5172.
2020-02-25 09:51:32 +01:00

20 lines
466 B
PHP

--TEST--
zend_strtod() leaks on big doubles
--INI--
precision=14
--FILE--
<?php
var_dump("1139932690.21688500" - "1139932790.21688500");
var_dump("1139932690000.21688500" - "331139932790.21688500");
var_dump("339932690.21688500" - "4564645646456463461139932790.21688500");
var_dump("123123139932690.21688500" - "11399327900000000.21688500");
echo "Done\n";
?>
--EXPECT--
float(-100)
float(808792757210)
float(-4.5646456464564635E+27)
float(-11276204760067310)
Done