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);
Output for 5.5.0 - 5.6.28, 7.0.0 - 7.1.0
bool(false)
Output for hhvm-3.10.0 - 3.12.0
string(18) "{"a":"foo","b":[]}"
Output for 5.2.0 - 5.4.45
string(20) "{"a":"foo","b":null}"
Output for 4.3.2 - 5.1.6

Process exited with code 255.
Output for 4.3.0 - 4.3.1