Bug #72377 [NEW]: var_export bad number conversion

From: Date: Fri, 10 Jun 2016 12:31:41 +0000
Subject: Bug #72377 [NEW]: var_export bad number conversion
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-201519@lists.php.net to get a copy of this message
From:             stefano dot galeazzi at probanet dot it
Operating system: Ubuntu 16.04, Arch Linux
PHP version:      7.0.7
Package:          *General Issues
Bug Type:         Bug
Bug description:var_export bad number conversion

Description:
------------
var_export() makes unnecessary and wrong number conversions.

Test script:
---------------
php --version
PHP 7.0.7 (cli) (built: May 25 2016 18:40:26) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies

php -r 'echo(var_export(0.98) . "\n");'
0.97999999999999998


Expected result:
----------------
php -r 'echo(var_export(0.98) . "\n");'
0.98


Actual result:
--------------
php -r 'echo(var_export(0.98) . "\n");'
0.97999999999999998


-- 
Edit bug report at https://bugs.php.net/bug.php?id=72377&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=72377&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=72377&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=72377&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=72377&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=72377&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=72377&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=72377&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=72377&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=72377&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=72377&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=72377&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=72377&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=72377&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72377&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=72377&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=72377&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=72377&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=72377&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=72377&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=72377&r=mysqlcfg



Thread (6 messages)

« previous php.bugs (#201519) next »