|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
18 + 13 = ?
Subscribe to this entry?

 [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-2024 The PHP Group
All rights reserved.
Last updated: Thu Feb 22 15:01:29 2024 UTC