3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php json_decode("'string'"); var_dump(json_last_error(), json_last_error_msg()); json_decode("100"); // int var_dump(json_last_error(), json_last_error_msg()); json_decode("1."); // float var_dump(json_last_error(), json_last_error_msg()); json_decode("1.0"); // float var_dump(json_last_error(), json_last_error_msg()); json_decode(".0"); // float var_dump(json_last_error(), json_last_error_msg()); json_decode("true"); // bool var_dump(json_last_error(), json_last_error_msg());
based on NekOe
Output for 7.0.0 - 7.2.0
int(4) string(12) "Syntax error" int(0) string(8) "No error" int(4) string(12) "Syntax error" int(0) string(8) "No error" int(4) string(12) "Syntax error" int(0) string(8) "No error"
Output for 5.5.24 - 5.6.28
int(4) string(12) "Syntax error" int(0) string(8) "No error" int(0) string(8) "No error" int(0) string(8) "No error" int(0) string(8) "No error" int(0) string(8) "No error"
Output for 5.3.20 - 5.4.45
Fatal error: Call to undefined function json_last_error_msg() in /in/XgtpQ on line 3
Process exited with code 255.