3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function sendHttpStatus(int $statusCode, string $message): bool { echo $statusCode. ' ' .$message; } sendHttpStatus(404, "File Not Found"); // integer and string passed sendHttpStatus("403", "OK"); // string "403" coerced to int(403)
based on PI2ha
Output for 7.0.0 - 7.2.0
404 File Not Found Fatal error: Uncaught TypeError: Return value of sendHttpStatus() must be of the type boolean, none returned in /in/IHA6v:5 Stack trace: #0 /in/IHA6v(7): sendHttpStatus(404, 'File Not Found') #1 {main} thrown in /in/IHA6v on line 5
Process exited with code 255.
Output for 5.3.20 - 5.6.28
Parse error: syntax error, unexpected ':', expecting '{' in /in/IHA6v on line 3
Process exited with code 255.