3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo(null|int|string $a) {} foo([]);
Output for 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
Fatal error: Uncaught TypeError: foo(): Argument #1 ($a) must be of type string|int|null, array given, called in /in/qqP8E on line 5 and defined in /in/qqP8E:3 Stack trace: #0 /in/qqP8E(5): foo(Array) #1 {main} thrown in /in/qqP8E on line 3
Process exited with code 255.

preferences:
53.77 ms | 406 KiB | 5 Q