|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46730 json_decode and 32Bit Maschines
Submitted: 2008-12-02 12:53 UTC Modified: 2008-12-02 14:35 UTC
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: info at marcel-schlesinger dot de Assigned:
Status: Not a bug Package: JSON related
PHP Version: 5.2.6 OS: ALL
Private report: No CVE-ID: None
 [2008-12-02 12:53 UTC] info at marcel-schlesinger dot de
Using json_decode with numbers higher then 2147483647 on a 32Bit maschine is still wrong! E.g. 5095334700020 has to be converted into a float (a string would be also okay), but not into an integer!

Reproduce code:
   $json = '{"number":5095334700020}';

Expected result:
object(stdClass)#1 (1) {

it could also be:

object(stdClass)#1 (1) {
  string(13) "5095334700020"

Actual result:
object(stdClass)#1 (1) {


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-12-02 13:01 UTC] info at marcel-schlesinger dot de
Updated category
 [2008-12-02 14:35 UTC]
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.

Can't reproduce -- should be fixed since 5.2.4... Feel free to reopen if you're actually using 5.2.6 and seeing this. :-)
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 17:01:33 2024 UTC