3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $fp = fopen('php://stdin', 'r'); $json = @json_encode(array('a' => 'foo', 'b' => $fp)); var_dump($json, json_last_error_msg());
Output for 5.5.0 - 5.6.28, 7.0.0 - 7.1.0
bool(false) string(21) "Type is not supported"
Output for hhvm-3.10.0 - 3.12.0
string(18) "{"a":"foo","b":[]}" string(8) "No error"
Output for 5.2.0 - 5.4.45
Fatal error: Call to undefined function json_last_error_msg() in /in/QohfG on line 4
Process exited with code 255.
Output for 4.3.2 - 5.1.6

Process exited with code 255.
Output for 4.3.0 - 4.3.1