3v4l.org

run code in 300+ PHP versions simultaneously
<?php print_r(array( 'JSON_ERROR_NONE' => JSON_ERROR_NONE, 'JSON_ERROR_DEPTH' => JSON_ERROR_DEPTH, 'JSON_ERROR_STATE_MISMATCH' => JSON_ERROR_STATE_MISMATCH, 'JSON_ERROR_CTRL_CHAR' => JSON_ERROR_CTRL_CHAR, 'JSON_ERROR_SYNTAX' => JSON_ERROR_SYNTAX, 'JSON_ERROR_UTF8' => JSON_ERROR_UTF8, 'JSON_ERROR_RECURSION' => JSON_ERROR_RECURSION, 'JSON_ERROR_INF_OR_NAN' => JSON_ERROR_INF_OR_NAN, 'JSON_ERROR_UNSUPPORTED_TYPE' => JSON_ERROR_UNSUPPORTED_TYPE )); $vTest = array("test"=> null); echo json_encode($vTest);
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.30, 8.2.0 - 8.2.24, 8.3.0 - 8.3.12
Array ( [JSON_ERROR_NONE] => 0 [JSON_ERROR_DEPTH] => 1 [JSON_ERROR_STATE_MISMATCH] => 2 [JSON_ERROR_CTRL_CHAR] => 3 [JSON_ERROR_SYNTAX] => 4 [JSON_ERROR_UTF8] => 5 [JSON_ERROR_RECURSION] => 6 [JSON_ERROR_INF_OR_NAN] => 7 [JSON_ERROR_UNSUPPORTED_TYPE] => 8 ) {"test":null}
Output for 5.3.3 - 5.3.29, 5.4.0 - 5.4.45
Notice: Use of undefined constant JSON_ERROR_RECURSION - assumed 'JSON_ERROR_RECURSION' in /in/skk6m on line 10 Notice: Use of undefined constant JSON_ERROR_INF_OR_NAN - assumed 'JSON_ERROR_INF_OR_NAN' in /in/skk6m on line 11 Notice: Use of undefined constant JSON_ERROR_UNSUPPORTED_TYPE - assumed 'JSON_ERROR_UNSUPPORTED_TYPE' in /in/skk6m on line 13 Array ( [JSON_ERROR_NONE] => 0 [JSON_ERROR_DEPTH] => 1 [JSON_ERROR_STATE_MISMATCH] => 2 [JSON_ERROR_CTRL_CHAR] => 3 [JSON_ERROR_SYNTAX] => 4 [JSON_ERROR_UTF8] => 5 [JSON_ERROR_RECURSION] => JSON_ERROR_RECURSION [JSON_ERROR_INF_OR_NAN] => JSON_ERROR_INF_OR_NAN [JSON_ERROR_UNSUPPORTED_TYPE] => JSON_ERROR_UNSUPPORTED_TYPE ) {"test":null}
Output for 5.3.0 - 5.3.2
Notice: Use of undefined constant JSON_ERROR_UTF8 - assumed 'JSON_ERROR_UTF8' in /in/skk6m on line 9 Notice: Use of undefined constant JSON_ERROR_RECURSION - assumed 'JSON_ERROR_RECURSION' in /in/skk6m on line 10 Notice: Use of undefined constant JSON_ERROR_INF_OR_NAN - assumed 'JSON_ERROR_INF_OR_NAN' in /in/skk6m on line 11 Notice: Use of undefined constant JSON_ERROR_UNSUPPORTED_TYPE - assumed 'JSON_ERROR_UNSUPPORTED_TYPE' in /in/skk6m on line 13 Array ( [JSON_ERROR_NONE] => 0 [JSON_ERROR_DEPTH] => 1 [JSON_ERROR_STATE_MISMATCH] => 2 [JSON_ERROR_CTRL_CHAR] => 3 [JSON_ERROR_SYNTAX] => 4 [JSON_ERROR_UTF8] => JSON_ERROR_UTF8 [JSON_ERROR_RECURSION] => JSON_ERROR_RECURSION [JSON_ERROR_INF_OR_NAN] => JSON_ERROR_INF_OR_NAN [JSON_ERROR_UNSUPPORTED_TYPE] => JSON_ERROR_UNSUPPORTED_TYPE ) {"test":null}
Output for 5.2.0 - 5.2.17
Notice: Use of undefined constant JSON_ERROR_NONE - assumed 'JSON_ERROR_NONE' in /in/skk6m on line 4 Notice: Use of undefined constant JSON_ERROR_DEPTH - assumed 'JSON_ERROR_DEPTH' in /in/skk6m on line 5 Notice: Use of undefined constant JSON_ERROR_STATE_MISMATCH - assumed 'JSON_ERROR_STATE_MISMATCH' in /in/skk6m on line 6 Notice: Use of undefined constant JSON_ERROR_CTRL_CHAR - assumed 'JSON_ERROR_CTRL_CHAR' in /in/skk6m on line 7 Notice: Use of undefined constant JSON_ERROR_SYNTAX - assumed 'JSON_ERROR_SYNTAX' in /in/skk6m on line 8 Notice: Use of undefined constant JSON_ERROR_UTF8 - assumed 'JSON_ERROR_UTF8' in /in/skk6m on line 9 Notice: Use of undefined constant JSON_ERROR_RECURSION - assumed 'JSON_ERROR_RECURSION' in /in/skk6m on line 10 Notice: Use of undefined constant JSON_ERROR_INF_OR_NAN - assumed 'JSON_ERROR_INF_OR_NAN' in /in/skk6m on line 11 Notice: Use of undefined constant JSON_ERROR_UNSUPPORTED_TYPE - assumed 'JSON_ERROR_UNSUPPORTED_TYPE' in /in/skk6m on line 13 Array ( [JSON_ERROR_NONE] => JSON_ERROR_NONE [JSON_ERROR_DEPTH] => JSON_ERROR_DEPTH [JSON_ERROR_STATE_MISMATCH] => JSON_ERROR_STATE_MISMATCH [JSON_ERROR_CTRL_CHAR] => JSON_ERROR_CTRL_CHAR [JSON_ERROR_SYNTAX] => JSON_ERROR_SYNTAX [JSON_ERROR_UTF8] => JSON_ERROR_UTF8 [JSON_ERROR_RECURSION] => JSON_ERROR_RECURSION [JSON_ERROR_INF_OR_NAN] => JSON_ERROR_INF_OR_NAN [JSON_ERROR_UNSUPPORTED_TYPE] => JSON_ERROR_UNSUPPORTED_TYPE ) {"test":null}
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6
Notice: Use of undefined constant JSON_ERROR_NONE - assumed 'JSON_ERROR_NONE' in /in/skk6m on line 4 Notice: Use of undefined constant JSON_ERROR_DEPTH - assumed 'JSON_ERROR_DEPTH' in /in/skk6m on line 5 Notice: Use of undefined constant JSON_ERROR_STATE_MISMATCH - assumed 'JSON_ERROR_STATE_MISMATCH' in /in/skk6m on line 6 Notice: Use of undefined constant JSON_ERROR_CTRL_CHAR - assumed 'JSON_ERROR_CTRL_CHAR' in /in/skk6m on line 7 Notice: Use of undefined constant JSON_ERROR_SYNTAX - assumed 'JSON_ERROR_SYNTAX' in /in/skk6m on line 8 Notice: Use of undefined constant JSON_ERROR_UTF8 - assumed 'JSON_ERROR_UTF8' in /in/skk6m on line 9 Notice: Use of undefined constant JSON_ERROR_RECURSION - assumed 'JSON_ERROR_RECURSION' in /in/skk6m on line 10 Notice: Use of undefined constant JSON_ERROR_INF_OR_NAN - assumed 'JSON_ERROR_INF_OR_NAN' in /in/skk6m on line 11 Notice: Use of undefined constant JSON_ERROR_UNSUPPORTED_TYPE - assumed 'JSON_ERROR_UNSUPPORTED_TYPE' in /in/skk6m on line 13 Array ( [JSON_ERROR_NONE] => JSON_ERROR_NONE [JSON_ERROR_DEPTH] => JSON_ERROR_DEPTH [JSON_ERROR_STATE_MISMATCH] => JSON_ERROR_STATE_MISMATCH [JSON_ERROR_CTRL_CHAR] => JSON_ERROR_CTRL_CHAR [JSON_ERROR_SYNTAX] => JSON_ERROR_SYNTAX [JSON_ERROR_UTF8] => JSON_ERROR_UTF8 [JSON_ERROR_RECURSION] => JSON_ERROR_RECURSION [JSON_ERROR_INF_OR_NAN] => JSON_ERROR_INF_OR_NAN [JSON_ERROR_UNSUPPORTED_TYPE] => JSON_ERROR_UNSUPPORTED_TYPE ) Fatal error: Call to undefined function json_encode() in /in/skk6m on line 16
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Notice: Use of undefined constant JSON_ERROR_NONE - assumed 'JSON_ERROR_NONE' in /in/skk6m on line 4 Notice: Use of undefined constant JSON_ERROR_DEPTH - assumed 'JSON_ERROR_DEPTH' in /in/skk6m on line 5 Notice: Use of undefined constant JSON_ERROR_STATE_MISMATCH - assumed 'JSON_ERROR_STATE_MISMATCH' in /in/skk6m on line 6 Notice: Use of undefined constant JSON_ERROR_CTRL_CHAR - assumed 'JSON_ERROR_CTRL_CHAR' in /in/skk6m on line 7 Notice: Use of undefined constant JSON_ERROR_SYNTAX - assumed 'JSON_ERROR_SYNTAX' in /in/skk6m on line 8 Notice: Use of undefined constant JSON_ERROR_UTF8 - assumed 'JSON_ERROR_UTF8' in /in/skk6m on line 9 Notice: Use of undefined constant JSON_ERROR_RECURSION - assumed 'JSON_ERROR_RECURSION' in /in/skk6m on line 10 Notice: Use of undefined constant JSON_ERROR_INF_OR_NAN - assumed 'JSON_ERROR_INF_OR_NAN' in /in/skk6m on line 11 Notice: Use of undefined constant JSON_ERROR_UNSUPPORTED_TYPE - assumed 'JSON_ERROR_UNSUPPORTED_TYPE' in /in/skk6m on line 13 Array ( [JSON_ERROR_NONE] => JSON_ERROR_NONE [JSON_ERROR_DEPTH] => JSON_ERROR_DEPTH [JSON_ERROR_STATE_MISMATCH] => JSON_ERROR_STATE_MISMATCH [JSON_ERROR_CTRL_CHAR] => JSON_ERROR_CTRL_CHAR [JSON_ERROR_SYNTAX] => JSON_ERROR_SYNTAX [JSON_ERROR_UTF8] => JSON_ERROR_UTF8 [JSON_ERROR_RECURSION] => JSON_ERROR_RECURSION [JSON_ERROR_INF_OR_NAN] => JSON_ERROR_INF_OR_NAN [JSON_ERROR_UNSUPPORTED_TYPE] => JSON_ERROR_UNSUPPORTED_TYPE ) Fatal error: Call to undefined function: json_encode() in /in/skk6m on line 16
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
Notice: Use of undefined constant JSON_ERROR_NONE - assumed 'JSON_ERROR_NONE' in /in/skk6m on line 4 Notice: Use of undefined constant JSON_ERROR_DEPTH - assumed 'JSON_ERROR_DEPTH' in /in/skk6m on line 5 Notice: Use of undefined constant JSON_ERROR_STATE_MISMATCH - assumed 'JSON_ERROR_STATE_MISMATCH' in /in/skk6m on line 6 Notice: Use of undefined constant JSON_ERROR_CTRL_CHAR - assumed 'JSON_ERROR_CTRL_CHAR' in /in/skk6m on line 7 Notice: Use of undefined constant JSON_ERROR_SYNTAX - assumed 'JSON_ERROR_SYNTAX' in /in/skk6m on line 8 Notice: Use of undefined constant JSON_ERROR_UTF8 - assumed 'JSON_ERROR_UTF8' in /in/skk6m on line 9 Notice: Use of undefined constant JSON_ERROR_RECURSION - assumed 'JSON_ERROR_RECURSION' in /in/skk6m on line 10 Notice: Use of undefined constant JSON_ERROR_INF_OR_NAN - assumed 'JSON_ERROR_INF_OR_NAN' in /in/skk6m on line 11 Notice: Use of undefined constant JSON_ERROR_UNSUPPORTED_TYPE - assumed 'JSON_ERROR_UNSUPPORTED_TYPE' in /in/skk6m on line 13 Array ( [JSON_ERROR_NONE] => JSON_ERROR_NONE [JSON_ERROR_DEPTH] => JSON_ERROR_DEPTH [JSON_ERROR_STATE_MISMATCH] => JSON_ERROR_STATE_MISMATCH [JSON_ERROR_CTRL_CHAR] => JSON_ERROR_CTRL_CHAR [JSON_ERROR_SYNTAX] => JSON_ERROR_SYNTAX [JSON_ERROR_UTF8] => JSON_ERROR_UTF8 [JSON_ERROR_RECURSION] => JSON_ERROR_RECURSION [JSON_ERROR_INF_OR_NAN] => JSON_ERROR_INF_OR_NAN [JSON_ERROR_UNSUPPORTED_TYPE] => JSON_ERROR_UNSUPPORTED_TYPE ) Fatal error: Call to undefined function: json_encode() in /in/skk6m on line 16
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Use of undefined constant JSON_ERROR_NONE - assumed 'JSON_ERROR_NONE' in /in/skk6m on line 4 Notice: Use of undefined constant JSON_ERROR_DEPTH - assumed 'JSON_ERROR_DEPTH' in /in/skk6m on line 5 Notice: Use of undefined constant JSON_ERROR_STATE_MISMATCH - assumed 'JSON_ERROR_STATE_MISMATCH' in /in/skk6m on line 6 Notice: Use of undefined constant JSON_ERROR_CTRL_CHAR - assumed 'JSON_ERROR_CTRL_CHAR' in /in/skk6m on line 7 Notice: Use of undefined constant JSON_ERROR_SYNTAX - assumed 'JSON_ERROR_SYNTAX' in /in/skk6m on line 8 Notice: Use of undefined constant JSON_ERROR_UTF8 - assumed 'JSON_ERROR_UTF8' in /in/skk6m on line 9 Notice: Use of undefined constant JSON_ERROR_RECURSION - assumed 'JSON_ERROR_RECURSION' in /in/skk6m on line 10 Notice: Use of undefined constant JSON_ERROR_INF_OR_NAN - assumed 'JSON_ERROR_INF_OR_NAN' in /in/skk6m on line 11 Notice: Use of undefined constant JSON_ERROR_UNSUPPORTED_TYPE - assumed 'JSON_ERROR_UNSUPPORTED_TYPE' in /in/skk6m on line 13 Array ( [JSON_ERROR_NONE] => JSON_ERROR_NONE [JSON_ERROR_DEPTH] => JSON_ERROR_DEPTH [JSON_ERROR_STATE_MISMATCH] => JSON_ERROR_STATE_MISMATCH [JSON_ERROR_CTRL_CHAR] => JSON_ERROR_CTRL_CHAR [JSON_ERROR_SYNTAX] => JSON_ERROR_SYNTAX [JSON_ERROR_UTF8] => JSON_ERROR_UTF8 [JSON_ERROR_RECURSION] => JSON_ERROR_RECURSION [JSON_ERROR_INF_OR_NAN] => JSON_ERROR_INF_OR_NAN [JSON_ERROR_UNSUPPORTED_TYPE] => JSON_ERROR_UNSUPPORTED_TYPE ) Fatal error: Call to undefined function: json_encode() in /in/skk6m on line 16

preferences:
90.67 ms | 425 KiB | 5 Q