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,'s');
based on W3jI6
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 5 passed to foo() must be of the type integer, string given, called in /in/mUZUv on line 6 and defined in /in/mUZUv:2 Stack trace: #0 /in/mUZUv(6): foo(2, 3, 5, 76, 's') #1 {main} thrown in /in/mUZUv on line 2
Process exited with code 255.
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/mUZUv on line 6 and defined in /in/mUZUv 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/mUZUv 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/mUZUv on line 2
Process exited with code 255.