3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function a(array ...$a) { return array_merge($a); } $a = [1, 2, 3]; $b = 4; $c = a($a, $b); // $c = [1, 2, 3, 4] var_dump($c);
based on M85HL
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 2 passed to a() must be of the type array, integer given, called in /in/YlB4m on line 6 and defined in /in/YlB4m:3 Stack trace: #0 /in/YlB4m(6): a(Array, 4) #1 {main} thrown in /in/YlB4m on line 3
Process exited with code 255.
Output for 5.6.8 - 5.6.28
Catchable fatal error: Argument 2 passed to a() must be of the type array, integer given, called in /in/YlB4m on line 6 and defined in /in/YlB4m on line 3
Process exited with code 255.
Output for 5.4.2 - 5.5.35
Parse error: syntax error, unexpected '.', expecting '&' or variable (T_VARIABLE) in /in/YlB4m on line 3
Process exited with code 255.
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected '.', expecting '&' or T_VARIABLE in /in/YlB4m on line 3
Process exited with code 255.