- array_unshift: documentation ( source)
- implode: documentation ( source)
<?php
class Foo
{
protected function bar()
{
return implode(' ', func_get_args());
}
public function __call($method, $args)
{
array_unshift($args, $method);
return $this->bar(...$args);
}
}
echo (new Foo)->this('is','an','example','of','variadics');