3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function a(array ...$a) { var_dump($a); } $a = [1, 2, 3]; $b = 4; $c = a($a, $b); // $c = [1, 2, 3, 4] var_dump($c);
based on i2fGO
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/sk9WI on line 6 and defined in /in/sk9WI:3 Stack trace: #0 /in/sk9WI(6): a(Array, 4) #1 {main} thrown in /in/sk9WI on line 3
Process exited with code 255.
Output for 5.6.0 - 5.6.28
Catchable fatal error: Argument 2 passed to a() must be of the type array, integer given, called in /in/sk9WI on line 6 and defined in /in/sk9WI on line 3
Process exited with code 255.
Output for 5.4.0 - 5.5.38
Parse error: syntax error, unexpected '.', expecting '&' or variable (T_VARIABLE) in /in/sk9WI on line 3
Process exited with code 255.