#41673 [Asn->Csd]: json_encode breaks large numbers in arrays

From: Date: Wed, 13 Jun 2007 17:57:17 +0000
Subject: #41673 [Asn->Csd]: json_encode breaks large numbers in arrays
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-113745@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: Assigned +Status: Closed Bug Type: JSON related Operating System: Unix PHP Version: 5CVS-2007-06-12 (CVS) Assigned To: iliaa New Comment: This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. 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

« previous php.bugs (#113745) next »