Bug #66179 [Nab->ReO]: var_export() exports float as integer
| From: | vrana@php.net | Date: | Thu, 03 Jul 2014 16:48:04 +0000 |
| Subject: | Bug #66179 [Nab->ReO]: var_export() exports float as integer | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-186451@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=66179&edit=1
ID: 66179
Updated by: vrana@php.net
Reported by: david at grudl dot com
Summary: var_export() exports float as integer
-Status: Not a bug
+Status: Re-Opened
Type: Bug
Package: Variables related
PHP Version: 5.5.6
Block user comment: N
Private report: N
New Comment:
($a === eval('return ' . var_export($a, true) . ';')) should result in true for
any given $a. "1" isn't a correct representation of float(1) as it results in int(1).
Previous Comments:
------------------------------------------------------------------------
[2013-11-29 22:30:09] bwoebi@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
A float(1.0) is stored as a float(1) (it's the same), so var_export(1.0) outputs 1.
------------------------------------------------------------------------
[2013-11-27 09:41:30] utkarsh dot parekh at yahoo dot in
If you try this var_export(2.1245) returns "2.1245". It is right.
------------------------------------------------------------------------
[2013-11-26 15:56:35] david at grudl dot com
Description:
------------
var_export(1.0) returns "1" instead of "1.0" in all PHP versions
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=66179&edit=1