3v4l.org

run code in 300+ PHP versions simultaneously
<?php function example(string $foo) { print $foo; } // Fatal error: Uncaught TypeError: example(): Argument #1 ($foo) must be of type string, null given example(null);
Output for 8.1.23 - 8.1.31, 8.2.9 - 8.2.27, 8.3.0 - 8.3.15, 8.4.1 - 8.4.2
Fatal error: Uncaught TypeError: example(): Argument #1 ($foo) must be of type string, null given, called in /in/6rsRd on line 9 and defined in /in/6rsRd:3 Stack trace: #0 /in/6rsRd(9): example(NULL) #1 {main} thrown in /in/6rsRd on line 3
Process exited with code 255.

preferences:
78.43 ms | 406 KiB | 5 Q