3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php var_dump(json_decode("\"a\"", false, 1)); var_dump(json_last_error()); var_dump(json_decode("\"a\"", false, 2)); var_dump(json_last_error());
Output for 5.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
string(1) "a" int(0) string(1) "a" int(0)
Output for 5.2.3 - 5.2.17
Warning: json_decode() expects at most 2 parameters, 3 given in /in/vYfpO on line 3 NULL Fatal error: Call to undefined function json_last_error() in /in/vYfpO on line 4
Process exited with code 255.
Output for 5.2.0 - 5.2.2
<br /> <b>Warning</b>: json_decode() expects at most 2 parameters, 3 given in <b>/in/vYfpO</b> on line <b>3</b><br /> NULL <br /> <b>Fatal error</b>: Call to undefined function json_last_error() in <b>/in/vYfpO</b> on line <b>4</b><br />
Process exited with code 255.
Output for 5.0.0 - 5.1.6
<br /> <b>Fatal error</b>: Call to undefined function json_decode() in <b>/in/vYfpO</b> on line <b>3</b><br />
Process exited with code 255.
Output for 4.4.5 - 4.4.9
<br /> <b>Fatal error</b>: Call to undefined function: json_decode() in <b>/in/vYfpO</b> on line <b>3</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.4.4
<br /> <b>Fatal error</b>: Call to undefined function: json_decode() in <b>/in/vYfpO</b> on line <b>3</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<br /> <b>Fatal error</b>: Call to undefined function: json_decode() in <b>/in/vYfpO</b> on line <b>3</b><br />