Bug #63193 [Fbk->Nab]: json_decode procudes wrong int values
Edit report at https://bugs.php.net/bug.php?id=63193&edit=1
ID: 63193
Updated by: rasmus@php.net
Reported by: jan dot winkler at adspirit dot de
Summary: json_decode procudes wrong int values
-Status: Feedback
+Status: Not a bug
Type: Bug
Package: JSON related
Operating System: linux
PHP Version: 5.3.17
Block user comment: N
Private report: N
New Comment:
Works fine on 64-bit machines. Not much we can do about this.
Previous Comments:
------------------------------------------------------------------------
[2012-10-01 15:26:36] laruence@php.net
do you run with a 32-bit OS?
------------------------------------------------------------------------
[2012-10-01 13:03:06] jan dot winkler at adspirit dot de
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 this bug report at https://bugs.php.net/bug.php?id=63193&edit=1
Thread (7 messages)