mirror of
https://github.com/php/php-src.git
synced 2024-12-18 06:21:41 +08:00
a939805641
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.
30 lines
520 B
PHP
30 lines
520 B
PHP
--TEST--
|
|
testing integer overflow (32bit)
|
|
--INI--
|
|
serialize_precision=14
|
|
--SKIPIF--
|
|
<?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); ?>
|
|
--FILE--
|
|
<?php
|
|
|
|
$doubles = array(
|
|
0x1736123FFFAAA,
|
|
0XFFFFFFFFFFFFFFFFFF,
|
|
0xAAAAAAAAAAAAAAEEEEEEEEEBBB,
|
|
0x66666666666666666777777,
|
|
);
|
|
|
|
foreach ($doubles as $d) {
|
|
$l = $d;
|
|
var_dump($l);
|
|
}
|
|
|
|
echo "Done\n";
|
|
?>
|
|
--EXPECTF--
|
|
float(4.0833602971%dE+14)
|
|
float(4.7223664828%dE+21)
|
|
float(1.3521606402%dE+31)
|
|
float(1.9807040628%dE+27)
|
|
Done
|