3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{"a":TRUE}'; $jsoned = @json_decode($json); var_dump($jsoned, json_last_error()); var_dump( JSON_ERROR_NONE, JSON_ERROR_DEPTH, JSON_ERROR_STATE_MISMATCH, JSON_ERROR_CTRL_CHAR, JSON_ERROR_SYNTAX, JSON_ERROR_UTF8, JSON_ERROR_RECURSION, JSON_ERROR_INF_OR_NAN, JSON_ERROR_UNSUPPORTED_TYPE );
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.38, 7.0.0 - 7.0.33, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
NULL int(4) int(0) int(1) int(2) int(3) int(4) int(5) int(6) int(7) int(8)
Output for 5.3.3 - 5.3.29, 5.4.0 - 5.4.45
NULL int(4) Notice: Use of undefined constant JSON_ERROR_RECURSION - assumed 'JSON_ERROR_RECURSION' in /in/peraL on line 14 Notice: Use of undefined constant JSON_ERROR_INF_OR_NAN - assumed 'JSON_ERROR_INF_OR_NAN' in /in/peraL on line 15 Notice: Use of undefined constant JSON_ERROR_UNSUPPORTED_TYPE - assumed 'JSON_ERROR_UNSUPPORTED_TYPE' in /in/peraL on line 17 int(0) int(1) int(2) int(3) int(4) int(5) string(20) "JSON_ERROR_RECURSION" string(21) "JSON_ERROR_INF_OR_NAN" string(27) "JSON_ERROR_UNSUPPORTED_TYPE"
Output for 5.3.0 - 5.3.2
NULL int(4) Notice: Use of undefined constant JSON_ERROR_UTF8 - assumed 'JSON_ERROR_UTF8' in /in/peraL on line 13 Notice: Use of undefined constant JSON_ERROR_RECURSION - assumed 'JSON_ERROR_RECURSION' in /in/peraL on line 14 Notice: Use of undefined constant JSON_ERROR_INF_OR_NAN - assumed 'JSON_ERROR_INF_OR_NAN' in /in/peraL on line 15 Notice: Use of undefined constant JSON_ERROR_UNSUPPORTED_TYPE - assumed 'JSON_ERROR_UNSUPPORTED_TYPE' in /in/peraL on line 17 int(0) int(1) int(2) int(3) int(4) string(15) "JSON_ERROR_UTF8" string(20) "JSON_ERROR_RECURSION" string(21) "JSON_ERROR_INF_OR_NAN" string(27) "JSON_ERROR_UNSUPPORTED_TYPE"
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined function json_last_error() in /in/peraL on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6

Process exited with code 255.
Output for 4.3.0 - 4.3.1

preferences:
287.22 ms | 401 KiB | 423 Q