3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $val = stream_context_create(); var_dump(json_encode($val)); var_dump(json_last_error()); var_dump(PHP_VERSION_ID >= 50500 ? json_last_error_msg() : NULL);
Output for 5.5.0 - 7.1.0
bool(false) int(8) string(21) "Type is not supported"
Output for 5.3.3 - 5.4.45
Warning: json_encode(): type is unsupported, encoded as null in /in/Z91AD on line 3 string(4) "null" int(0) NULL
Output for 5.3.0 - 5.3.2
Warning: [json] (php_json_encode) type is unsupported, encoded as null in /in/Z91AD on line 3 string(4) "null" int(0) NULL
Output for 5.2.10 - 5.2.17
Warning: [json] (php_json_encode) type is unsupported, encoded as null in /in/Z91AD on line 3 string(4) "null" Fatal error: Call to undefined function json_last_error() in /in/Z91AD on line 4
Process exited with code 255.
Output for 5.2.0 - 5.2.9
Warning: [json] (json_encode_r) type is unsupported, encoded as null. in /in/Z91AD on line 3 string(4) "null" Fatal error: Call to undefined function json_last_error() in /in/Z91AD on line 4
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function json_encode() in /in/Z91AD on line 3
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: json_encode() in /in/Z91AD on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: json_encode() in /in/Z91AD on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: json_encode() in /in/Z91AD on line 3