3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // https://gist.github.com/dave1010/11393640 class Bar{} $bars = [new Bar, new Bar, new Bar]; function foo(Bar $bar, ... $bar) { // echo "Got " . count($bars) . " bars.\n"; var_dump(func_get_args()); } foo(...$bars);
Output for 5.6.8 - 5.6.28, hhvm-3.10.0 - 3.12.0
array(3) { [0]=> object(Bar)#1 (0) { } [1]=> object(Bar)#2 (0) { } [2]=> object(Bar)#3 (0) { } }
Output for 5.4.0 - 5.4.28
Parse error: syntax error, unexpected '.', expecting '&' or variable (T_VARIABLE) in /in/ImTjs on line 9
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected '[' in /in/ImTjs on line 7
Process exited with code 255.