calling method of object of object with call_user_func

前端 未结 2 1110
时光说笑
时光说笑 2021-02-02 08:57

consider this simple scenario:

$this->method($arg1, $arg2);

Solution:

call_user_func_array(array($this,\'method\'), array($a         


        
2条回答
  •  遥遥无期
    2021-02-02 09:23

    This should work:

    call_user_func_array(array($this->object,'method'), array($arg1, $arg2));
    

    The first argument is a callback type, containing an object reference and a method name.

提交回复
热议问题