3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php header('Content-Type: application/json'); function returnJSON (string $string, bool $success) { exit(json_encode(['success' => $success, 'message' => $string])); //doesnt print anything } if (true) returnJSON("This message is not printed...", false);
Output for 7.0.28 - 7.3.0rc3
{"success":false,"message":"This message is not printed..."}
Output for 5.6.38
Catchable fatal error: Argument 1 passed to returnJSON() must be an instance of string, string given, called in /in/aNjha on line 10 and defined in /in/aNjha on line 5
Process exited with code 255.