Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Warning: json_decode() expects at most 2 parameters, 4 given

Tags:

json

php

I tried to use json_decode like this:

json_decode($string, true, 100, JSON_BIGINT_AS_STRING);

but i got the error:

Warning: json_decode() expects at most 2 parameters, 4 given in /home/content/27/2326027/html/sys/get.php on line 38

any response would be apprecaite

like image 981
yuhai Avatar asked May 09 '12 02:05

yuhai


1 Answers

Seems like your PHP version doesn't support those parameters.

See manual:

Version     Description
5.4.0   The options parameter was added.
5.3.0   Added the optional depth. The default recursion depth was increased from 128 to 512
5.2.3   The nesting limit was increased from 20 to 128
5.2.1   Added support for JSON decoding of basic types. 

To use the code you written, you should need atleast 5.4.0 version...

like image 79
Mārtiņš Briedis Avatar answered Sep 20 '22 09:09

Mārtiņš Briedis