3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function foo(int ...$x) { echo array_sum($x); } foo(2,3,5,76);
based on v8pui
Output for 7.0.0 - 7.2.0
86
Output for 5.6.8 - 5.6.28
Catchable fatal error: Argument 1 passed to foo() must be an instance of int, integer given, called in /in/W3jI6 on line 6 and defined in /in/W3jI6 on line 2
Process exited with code 255.
Output for 5.4.11 - 5.5.35
Parse error: syntax error, unexpected '.', expecting '&' or variable (T_VARIABLE) in /in/W3jI6 on line 2
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected '.', expecting '&' or T_VARIABLE in /in/W3jI6 on line 2
Process exited with code 255.