3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr_g = array('result' => 'success'); $arr_f = array('result' => 'error'); header('Content-Type: application/json'); if ($_GET["id"]=="7865" || $_GET["id"]=="4598") { echo json_encode($arr_g); } else echo json_encode($arr_f);
Output for 5.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Notice: Undefined index: id in /in/F89jq on line 5 Notice: Undefined index: id in /in/F89jq on line 5 {"result":"error"}
Output for 5.2.0 - 5.2.17
Notice: Undefined index: id in /in/F89jq on line 5 Notice: Undefined index: id in /in/F89jq on line 5 {"result":"error"}
Output for 5.0.0 - 5.1.6
Notice: Undefined index: id in /in/F89jq on line 5 Notice: Undefined index: id in /in/F89jq on line 5 Fatal error: Call to undefined function json_encode() in /in/F89jq on line 9
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Notice: Undefined index: id in /in/F89jq on line 5 Notice: Undefined index: id in /in/F89jq on line 5 Fatal error: Call to undefined function: json_encode() in /in/F89jq on line 9
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Notice: Undefined index: id in /in/F89jq on line 5 Notice: Undefined index: id in /in/F89jq on line 5 Fatal error: Call to undefined function: json_encode() in /in/F89jq on line 9
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Undefined index: id in /in/F89jq on line 5 Notice: Undefined index: id in /in/F89jq on line 5 Fatal error: Call to undefined function: json_encode() in /in/F89jq on line 9