/*对函数的引用 notice: Only variable references should be returned by reference */
function &asd($a)
{
$a++;
return $a;
//return ++$a;会有警告
}
$x = &asd(2);//对函数的引用实际上就是对函数返回值的引用
echo $x;
函数引用
最新推荐文章于 2020-09-17 13:09:39 发布
/*对函数的引用 notice: Only variable references should be returned by reference */
function &asd($a)
{
$a++;
return $a;
//return ++$a;会有警告
}
$x = &asd(2);//对函数的引用实际上就是对函数返回值的引用
echo $x;