|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62263 json_decode doesnt take 4 arguments only 3
Submitted: 2012-06-08 09:21 UTC Modified: 2012-06-10 07:59 UTC
From: briankchristensen at gmail dot com Assigned:
Status: Not a bug Package: json (PECL)
PHP Version: 5.3.13 OS: Windows 7
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:
From: briankchristensen at gmail dot com
New email:
PHP Version: OS:


 [2012-06-08 09:21 UTC] briankchristensen at gmail dot com
From manual page:
Example #5 from the documentation doesn't work, where the fourth argument is 

Test script:
$json = '12345678901234567890';

var_dump(json_decode($json, false, 512, JSON_BIGINT_AS_STRING));


Expected result:
string(20) "12345678901234567890"

Actual result:
ErrorException [ Warning ]: json_decode() expects at most 3 parameters, 4 given


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-06-08 12:44 UTC] Sjon at hortensius dot net
The manual always reflects the latest stable version of PHP. Have a look at the 

> 5.4.0  The options parameter was added.

I'd say this is not a bug
 [2012-06-08 23:28 UTC]
-Status: Open +Status: Not a bug
 [2012-06-08 23:28 UTC]
Yup, Sjon is right. The parameter was added in 5.4.
 [2012-06-10 07:59 UTC] briankchristensen at gmail dot com
If that is so, it could be creat to mension it in the documentation.
Like this options parameter is available as of PHP 5.4

Thanks for the quick response
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Sep 21 18:01:24 2023 UTC