Bug #74161 [Opn->Nab]: var_export values displayed incorrectly
| From: | requinix@php.net | Date: | Fri, 24 Feb 2017 06:19:42 +0000 |
| Subject: | Bug #74161 [Opn->Nab]: var_export values displayed incorrectly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-207537@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74161&edit=1
ID: 74161
Updated by: requinix@php.net
Reported by: tj dot krause at springscs dot org
Summary: var_export values displayed incorrectly
-Status: Open
+Status: Not a bug
Type: Bug
-Package: Reflection related
+Package: *General Issues
Operating System: Ubuntu 14.04 64 bit
PHP Version: 7.0.16
Block user comment: N
Private report: N
New Comment:
var_dump respects the float precision settings. var_export does not so that it can always export the
value accurately.
Previous Comments:
------------------------------------------------------------------------
[2017-02-24 02:07:51] tj dot krause at springscs dot org
Description:
------------
var_export outputs float values incorrectly.
Test script:
---------------
<?php
var_export(3.3);
var_export(1.0);
var_dump(3.3);
var_dump(1.0);
Expected result:
----------------
var_export(3.3) should display 3.3.
Float values should be converted directly to strings without modification.
Actual result:
--------------
root@app:/backup/mysql# php -a
Interactive mode enabled
php > var_export(1.0);
1.0
php > var_export(3.3);
3.2999999999999998
php > var_dump(1.0);
float(1)
php > var_dump(3.3);
float(3.3)
php >
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74161&edit=1