3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(json_decode("{foo: Infinity}")); $st = new stdclass; $st->test = INF; var_dump(json_encode($st));
based on Bodte
Output for 5.5.0 - 7.2.0
NULL bool(false)
Output for 5.3.3 - 5.4.45
NULL Warning: json_encode(): double INF does not conform to the JSON spec, encoded as 0 in /in/db71E on line 8 string(10) "{"test":0}"
Output for 5.2.10 - 5.3.2
NULL Warning: [json] (php_json_encode) double INF does not conform to the JSON spec, encoded as 0 in /in/db71E on line 8 string(10) "{"test":0}"
Output for 5.2.0 - 5.2.9
NULL Warning: [json] (json_encode_r) double INF does not conform to the JSON spec, encoded as 0. in /in/db71E on line 8 string(10) "{"test":0}"
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function json_decode() in /in/db71E on line 3
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: json_decode() in /in/db71E on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: json_decode() in /in/db71E on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: json_decode() in /in/db71E on line 3