3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f(array $a) { var_dump($a); } f(array(5)); f(3);
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
array(1) { [0]=> int(5) } Fatal error: Uncaught TypeError: f(): Argument #1 ($a) must be of type array, int given, called in /in/NAEhv on line 8 and defined in /in/NAEhv:3 Stack trace: #0 /in/NAEhv(8): f(3) #1 {main} thrown in /in/NAEhv on line 3
Process exited with code 255.
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
array(1) { [0]=> int(5) } Fatal error: Uncaught TypeError: Argument 1 passed to f() must be of the type array, int given, called in /in/NAEhv on line 8 and defined in /in/NAEhv:3 Stack trace: #0 /in/NAEhv(8): f(3) #1 {main} thrown in /in/NAEhv on line 3
Process exited with code 255.
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33
array(1) { [0]=> int(5) } Fatal error: Uncaught TypeError: Argument 1 passed to f() must be of the type array, integer given, called in /in/NAEhv on line 8 and defined in /in/NAEhv:3 Stack trace: #0 /in/NAEhv(8): f(3) #1 {main} thrown in /in/NAEhv on line 3
Process exited with code 255.
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.38
array(1) { [0]=> int(5) } Catchable fatal error: Argument 1 passed to f() must be of the type array, integer given, called in /in/NAEhv on line 8 and defined in /in/NAEhv on line 3
Process exited with code 255.

preferences:
226.41 ms | 402 KiB | 336 Q