var_dump has differing precision between PHP 7 and 8

This is probably due to the locale-neutral float conversion.
var_dump will show an extra 3 digits of precisions varying, but
var_export seems to always show the remaining 3 digits. Many of the
other conversion functions could have been used instead if we did
not want to show the last three digits.
This commit is contained in:
Calvin Buckley
2020-12-02 19:40:40 -04:00
parent b4aeda2a57
commit 650ff1197d

View File

@@ -21,7 +21,8 @@ if ($conn) {
$res = db2_exec($conn, "SELECT tz_offset from test1R");
while ($row = db2_fetch_both($res)) {
var_dump($row);
echo(var_export($row[0], true) . "\n");
echo(var_export($row["TZ_OFFSET"], true) . "\n");
}
// Dropping the test table.
@@ -33,9 +34,5 @@ if ($conn) {
}
?>
--EXPECT--
array(2) {
["TZ_OFFSET"]=>
float(-2.3399999141693)
[0]=>
float(-2.3399999141693)
}
-2.3399999141693115
-2.3399999141693115