3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $responseCode = 0; function validate($n) { return $n; } function responseFromCode($code) { if ($code == 100) { return '{"status":100, "status_text":"Invalid User"}'; } if ($code == 200) { return '{"status":200, "status_text":"Invalid Company"}'; } if ($code == 300) { return '{"status":300, "status_text":"Feature Not enabled"}'; } return '{"status":400, "status_text":"Internal Error"}'; } $responseCode=validate(100); echo $responseCode; if ($responseCode != 1) { echo jsonresponseFromCode($responseCode); } else { echo "validated"; } ?>
Output for 7.0.0 - 7.1.0
100 Fatal error: Uncaught Error: Call to undefined function jsonresponseFromCode() in /in/PAXQW:25 Stack trace: #0 {main} thrown in /in/PAXQW on line 25
Process exited with code 255.
Output for 5.0.0 - 5.6.28
100 Fatal error: Call to undefined function jsonresponseFromCode() in /in/PAXQW on line 25
Process exited with code 255.
Output for 4.4.5 - 4.4.9
100 Fatal error: Call to undefined function: jsonresponsefromcode() in /in/PAXQW on line 25
Process exited with code 255.
Output for 4.3.2 - 4.4.4
100 Fatal error: Call to undefined function: jsonresponsefromcode() in /in/PAXQW on line 25
Process exited with code 255.
Output for 4.3.0 - 4.3.1
100 Fatal error: Call to undefined function: jsonresponsefromcode() in /in/PAXQW on line 25