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

33 lines
364 B
PHP

--TEST--
dividing doubles
--INI--
precision=14
--FILE--
<?php
$d1 = 1.1;
$d2 = 434234.234;
$c = $d2 / $d1;
var_dump($c);
$d1 = 1.1;
$d2 = "434234.234";
$c = $d2 / $d1;
var_dump($c);
$d1 = "1.1";
$d2 = "434234.234";
$c = $d2 / $d1;
var_dump($c);
echo "Done\n";
?>
--EXPECT--
float(394758.39454545453)
float(394758.39454545453)
float(394758.39454545453)
Done