|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63737 json_decode does not properly decode with options parameter
Submitted: 2012-12-11 11:03 UTC Modified: 2013-01-08 03:59 UTC
From: Assigned: aharvey (profile)
Status: Closed Package: JSON related
PHP Version: 5.4.9 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2012-12-11 11:03 UTC]
json_decode does not properly decode JSON strings using options parameter.

Test script:
json_decode('12345678901234567890', false, 512, JSON_BIGINT_AS_STRING); // this won't work

However this will

json_decode('[12345678901234567890]', false, 512, JSON_BIGINT_AS_STRING);

Expected result:
string(20) "12345678901234567890"

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-12-11 11:04 UTC]
Our code path for bare integer literals is different to the one we use for literals within objects and arrays. Should be an easy fix.
 [2012-12-11 11:04 UTC]
-Status: Open +Status: Analyzed -Assigned To: +Assigned To: aharvey
 [2012-12-11 12:04 UTC]
-Status: Analyzed +Status: Closed
 [2012-12-11 12:04 UTC]
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

Fixed on 5.4, 5.5 and master.
 [2013-01-02 11:46 UTC] franssen dot roland at gmail dot com
This is still an issue in 5.4.10 (Linux)
 [2013-01-02 20:13 UTC]
-Status: Closed +Status: Re-Opened
 [2013-01-02 20:18 UTC]
This commit has been removed from the release branch for some reason.
 [2013-01-08 03:59 UTC]
It was never on the release branch: I committed it after 5.4.10 was branched. It'll be in 5.4.11.
 [2013-01-08 03:59 UTC]
-Status: Re-Opened +Status: Closed
 [2013-01-08 03:59 UTC]
It was never on the release branch: I committed it after 5.4.10 was branched. It'll be in 5.4.11.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jun 24 00:01:30 2024 UTC