3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test(string $t) { echo $t.PHP_EOL; } test('Hello!'); test(null);
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
Hello! Fatal error: Uncaught TypeError: test(): Argument #1 ($t) must be of type string, null given, called in /in/EjaSW on line 8 and defined in /in/EjaSW:3 Stack trace: #0 /in/EjaSW(8): test(NULL) #1 {main} thrown in /in/EjaSW on line 3
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33
Hello! Fatal error: Uncaught TypeError: Argument 1 passed to test() must be of the type string, null given, called in /in/EjaSW on line 8 and defined in /in/EjaSW:3 Stack trace: #0 /in/EjaSW(8): test(NULL) #1 {main} thrown in /in/EjaSW on line 3
Process exited with code 255.
Output for 5.6.0 - 5.6.28
Catchable fatal error: Argument 1 passed to test() must be an instance of string, string given, called in /in/EjaSW on line 7 and defined in /in/EjaSW on line 3
Process exited with code 255.

preferences:
159.34 ms | 401 KiB | 194 Q