3v4l.org

run code in 300+ PHP versions simultaneously
<?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)
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
404 File Not Found Fatal error: Uncaught TypeError: sendHttpStatus(): Return value must be of type bool, 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 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
404 File Not Found Fatal error: Uncaught TypeError: Return value of sendHttpStatus() must be of the type bool, 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 7.0.0 - 7.0.33, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33
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.5.0 - 5.5.38, 5.6.0 - 5.6.38
Parse error: syntax error, unexpected ':', expecting '{' in /in/IHA6v on line 3
Process exited with code 255.

preferences:
228.67 ms | 402 KiB | 293 Q