3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo(\array $a) {} foo([]); // Fatal error: Uncaught TypeError: foo(): // Argument #1 ($a) must be of type array, array given ?>
Output for 8.5.0 - 8.5.3
Fatal error: Cannot use "array" as a type name as it is reserved in /in/q4nrY on line 3 Stack trace: #0 {main}
Process exited with code 255.
Output for 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18
Fatal error: Uncaught TypeError: foo(): Argument #1 ($a) must be of type array, array given, called in /in/q4nrY on line 5 and defined in /in/q4nrY:3 Stack trace: #0 /in/q4nrY(5): foo(Array) #1 {main} thrown in /in/q4nrY on line 3
Process exited with code 255.

preferences:
51.24 ms | 860 KiB | 4 Q