From: jan dot winkler at adspirit dot de Operating system: linux PHP version: 5.3.17 Package: JSON related Bug Type: Bug Bug description:json_decode procudes wrong int values
Description:
------------
the following code produces a wrong number when decoded:
$a = array('a'=>5584842151736052644);
$x = json_encode($a);
print_r(json_decode($x));
... will output stdClass Object ( [a] => 5584842151736052736 ) instead of
5584842151736052644
Test script:
---------------
$a = array('a'=>5584842151736052644);
$x = json_encode($a);
print_r(json_decode($x));
Expected result:
----------------
json_decode should output stdClass Object ( [a] => 5584842151736052644 )
Actual result:
--------------
stdClass Object ( [a] => 5584842151736052736 )
--
Edit bug report at https://bugs.php.net/bug.php?id=63193&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=63193&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=63193&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=63193&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=63193&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=63193&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=63193&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=63193&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=63193&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=63193&r=support
Expected behavior: https://bugs.php.net/fix.php?id=63193&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=63193&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=63193&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=63193&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63193&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=63193&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=63193&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=63193&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63193&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=63193&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=63193&r=mysqlcfg
