3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function foo() { $numargs = func_num_args(); echo "Number of arguments: $numargs<br />\n"; if ($numargs >= 2) { echo "Second argument is: " . func_get_arg (1) . "<br />\n"; } $arg_list = func_get_args(); unset($arg_list[0]); foreach ($arg_list as $arg) { echo "Argument is: " . $arg . "<br />\n"; } } foo (1, 2, 3);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Number of arguments: 3<br /> Second argument is: 2<br /> Argument is: 2<br /> Argument is: 3<br />