3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $obj = (object) array("_empty_" => "foo"); print_r($obj); print json_encode($obj);
based on flicQ
Output for 5.2.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
stdClass Object ( [_empty_] => foo ) {"_empty_":"foo"}
Output for 5.0.0 - 5.1.6
stdClass Object ( [_empty_] => foo ) Fatal error: Call to undefined function json_encode() in /in/QS3LE on line 4
Process exited with code 255.
Output for 4.4.5 - 4.4.9
stdClass Object ( [_empty_] => foo ) Fatal error: Call to undefined function: json_encode() in /in/QS3LE on line 4
Process exited with code 255.
Output for 4.3.2 - 4.4.4
stdClass Object ( [_empty_] => foo ) Fatal error: Call to undefined function: json_encode() in /in/QS3LE on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
stdClass Object ( [_empty_] => foo ) Fatal error: Call to undefined function: json_encode() in /in/QS3LE on line 4