Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/256.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何包装接受无限个参数的函数_Php_Argument Passing - Fatal编程技术网

Php 如何包装接受无限个参数的函数

Php 如何包装接受无限个参数的函数,php,argument-passing,Php,Argument Passing,我想包装一个接受无限个参数的现有函数, e、 g.这是现有的功能: function T() { $args = func_num_args(); // Do stuff with arguments. } 我现在想把它包起来 /* * This function shall also take unlimited arguments, * and just pass them on to T(). */ function myT() { // TODO: Tak

我想包装一个接受无限个参数的现有函数, e、 g.这是现有的功能:

function T()
{
    $args = func_num_args();
    // Do stuff with arguments.
}
我现在想把它包起来

/*
 * This function shall also take unlimited arguments,
 * and just pass them on to T().
 */
function myT()
{
    // TODO: Take all arguments and pass them on to T().
    $result = T();

    // Do stuff with the result of T().
}

但是,我不知道如何将无限参数传递给
myT()
中的
T()

使用
call\u user\u func\u array()
()

$res = call_user_func_array("T", func_get_args());