#41673 [Opn->Asn]: json_encode breaks large numbers in arrays
| From: | iliaa@php.net | Date: | Wed, 13 Jun 2007 12:30:26 +0000 |
| Subject: | #41673 [Opn->Asn]: json_encode breaks large numbers in arrays | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-113737@lists.php.net to get a copy of this message | ||
ID: 41673
Updated by: iliaa@php.net
Reported By: stas at zend dot com
-Status: Open
+Status: Assigned
Bug Type: JSON related
Operating System: Unix
PHP Version: 5CVS-2007-06-12 (CVS)
-Assigned To:
+Assigned To: iliaa
Previous Comments:
------------------------------------------------------------------------
[2007-06-12 20:12:54] stas at zend dot com
Description:
------------
When array with big numbers is encoded with json_encode, the result
contains entirely different number.
Reproduce code:
---------------
<?php
$b = array(40000000000000);
var_dump(json_encode($b));
Expected result:
----------------
string "[40000000000000]"
or
string "[4.0e13]"
Actual result:
--------------
string(11) "[969572352]"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41673&edit=1