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.30, 8.2.9 - 8.2.25, 8.3.0 - 8.3.14
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:
58.08 ms | 406 KiB | 5 Q