PHP通过反射机制调用可变参数方法
<?php
class A {
public function f1($operation, $destKey, Array $keys) {
$method = new ReflectionMethod($this, 'f2');
array_unshift($keys, $operation, $destKey);
return $method->invokeArgs($this, $keys);
}
public function f2() {
var_dump(func_get_args());
}
}
(new A())->f1('AND', 'dest', array('s1', 's2', 's3'));