3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f() { var_dump(func_get_args()); } class C implements IteratorAggregate { private $arr; function __construct(array $arr) {$this->arr = $arr;} function getIterator() { return new ArrayIterator($this->arr); } } $a = array('a' => 1, 'b' => 2, 3, 4, 5); $c = new C($a); call_user_func_array('f', $c);

preferences:
37.32 ms | 402 KiB | 5 Q