Php 函数长度可变的函数的按引用传递
我有一个具有可选参数数的函数,如下所示:Php 函数长度可变的函数的按引用传递,php,Php,我有一个具有可选参数数的函数,如下所示: function DoSomething() { $args = funct_get_args(); // and the rest of function } 在上面的函数中,如何定义要通过引用传递的第一个参数 因此,当我调用它时,我可以这样做: DoSomething(&$first, $second, $third); 只需在参数列表中声明它: function DoSomething(&$first) {
function DoSomething()
{
$args = funct_get_args();
// and the rest of function
}
在上面的函数中,如何定义要通过引用传递的第一个参数
因此,当我调用它时,我可以这样做:
DoSomething(&$first, $second, $third);
只需在参数列表中声明它:
function DoSomething(&$first) {
$args = func_get_args();
// and the rest of function
}
DoSomething($first, $second, $third);
只需在参数列表中声明它:
function DoSomething(&$first) {
$args = func_get_args();
// and the rest of function
}
DoSomething($first, $second, $third);