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.28, 8.2.9 - 8.2.19, 8.3.0 - 8.3.7
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:
49.92 ms | 402 KiB | 30 Q