PHP 如何调用 parent::__call() 并传入参数
2022-08-30 21:02:34
如果我在PHP类中重载该方法,如果我的代码不执行其他操作,我该如何调用实际方法?例如:__call
public function __call($name, $arguments)
{
if($name == 'tom')
{
$this->doName($name);
}
else
{
// Something here to carry on the __call maybe:
// $this->$name($arguments);
}
}
问题是,它们作为数组传递,我怎么能继续传递它们,信息有没有正确的方法可以做到这一点?$arguments
$this->$name($arg, $arg, $arg ...)