Bug #66179 [Com]: var_export() exports float as integer
| From: | lisachenko dot it at gmail dot com | Date: | Mon, 18 Jan 2016 18:42:56 +0000 |
| Subject: | Bug #66179 [Com]: var_export() exports float as integer | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-198764@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
Comment by: lisachenko dot it at gmail dot com
Reported by: david at grudl dot com
Summary: var_export() exports float as integer
Status: Closed
Type: Bug
Package: Variables related
PHP Version: 5.5.6
Assigned To: ajf
Block user comment: N
Private report: N
New Comment:
I think, that Reflection should also use this new logic for exporting float numbers: check https://3v4l.org/2JFbL
This will be consistent with current var_export behavior.
Previous Comments:
------------------------------------------------------------------------
[2016-01-08 17:20:06] ajf@php.net
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at
http://www.php.net/downloads.php
Fixed in 7.0.2. Unfortunately, I screwed up the fix, creating bug #71314.
------------------------------------------------------------------------
[2016-01-08 17:05:23] ajf@php.net
Related To: Bug #71314
------------------------------------------------------------------------
[2015-12-18 19:32:30] ajf@php.net
Automatic comment on behalf of ajf@ajf.me
Revision: http://git.php.net/?p=php-src.git;a=commit;h=8d217db369d83de22db6c2e6ad9a440d6c59518f
Log: Fix bug #66179
------------------------------------------------------------------------
[2015-12-18 19:31:52] ajf@php.net
Automatic comment on behalf of ajf@ajf.me
Revision: http://git.php.net/?p=php-src.git;a=commit;h=8d217db369d83de22db6c2e6ad9a440d6c59518f
Log: Fix bug #66179
------------------------------------------------------------------------
[2015-06-29 18:57:03] xuefer at gmail dot com
Not sure if this is the same problem
http://3v4l.org/ZRPXO
var_export(5.3); echo "\n";
var_dump(5.3); echo "\n";
outputs:
5.29999999999999982236432
float(5.3)
in this case luckily 5.29999999999999982236432 == 5.3, and it pass ($a === eval('return '
. var_export($a, true) . ';')) definition
but i give this example to show that var_dump is better (looking) than var_export on double value
so please take it seriously
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=66179
--
Edit this bug report at https://bugs.php.net/bug.php?id=66179&edit=1