php-src/Zend/tests/add_005.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

23 lines
252 B
PHP

--TEST--
adding integers to doubles
--INI--
precision=14
--FILE--
<?php
$i = 75636;
$d = 2834681123.123123;
$c = $i + $d;
var_dump($c);
$c = $d + $i;
var_dump($c);
echo "Done\n";
?>
--EXPECT--
float(2834756759.123123)
float(2834756759.123123)
Done