3v4l.org

run code in 500+ PHP versions simultaneously
<?php function foo(int|null $var): void {} foo("123test");
Output for 8.2.31 - 8.2.32, 8.3.5 - 8.3.33, 8.4.9 - 8.4.24, 8.5.1 - 8.5.9
Fatal error: Uncaught TypeError: foo(): Argument #1 ($var) must be of type ?int, string given, called in /in/C0uaK on line 5 and defined in /in/C0uaK:3 Stack trace: #0 /in/C0uaK(5): foo('123test') #1 {main} thrown in /in/C0uaK on line 3
Process exited with code 255.

preferences:
40.83 ms | 593 KiB | 4 Q