run code in 200+ php & hhvm versions
Bugs & Features
<?php function foo(string ...$strings) { var_dump($strings); } foo("one", "two", "three");
Output for 7.0.0 - 7.3.0beta1
array(3) { [0]=> string(3) "one" [1]=> string(3) "two" [2]=> string(5) "three" }
Output for hhvm-3.15.4
Fatal error: Uncaught Error: Parameter $strings is variadic and has a type constraint (HH\string); variadic params with type constraints are not supported in non-Hack files in /in/lbAQI:3 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Catchable fatal error: Argument 1 passed to foo() must be an instance of string, string given, called in /in/lbAQI on line 7 and defined in /in/lbAQI on line 3
Process exited with code 255.