当实参个数形参个数 时,在请看下面的例子:
}
$variablea=5;
$variableb=10;
echo "调用swap()函数前: ";
echo "实参a=$variablea,实参b=$variableb
\n";
swap($variablea,$variableb);
echo "调用swap()函数后: ";
echo "实参a=$variablea,实参b=$variableb
\n";
?>
}
$variablea=5;
$variableb=10;
echo "调用swap1()函数前: ";
echo "实参a=$variablea,实参b=$variableb
\n";
swap1($variablea,$variableb);
echo "调用swap1()函数后: ";
echo "实参a=$variablea,实参b=$variableb
\n";
?>
//上面的两个例子就是说明,求教了~~~
复制代码 代码如下:
//编写一个函数swap(),测试该函数的实参值无改变
function swap($a,$b) {
echo "
进入swqp()函数前
\n";
echo "交换前:形参a=$a,形参b=$b
\n";
$c=$b;
$a=$b;
$b=$c;
echo "交换后:形参a=$a,形参b=$b
\n";
echo "退出swap()函数
}
$variablea=5;
$variableb=10;
echo "调用swap()函数前: ";
echo "实参a=$variablea,实参b=$variableb
\n";
swap($variablea,$variableb);
echo "调用swap()函数后: ";
echo "实参a=$variablea,实参b=$variableb
\n";
?>
复制代码 代码如下:
//测试swap()函数实参的值改变
function swap1(&$a,&$b) {
echo "
进入swap1()函数
\n";
echo "交换前: 形参a=$a,形参b=$b
\n";
$c=$b;
$a=$b;
$b=$c;
echo "交换后: 形参a=$a,形参b=$b
\n";
echo "退出swap()函数
}
$variablea=5;
$variableb=10;
echo "调用swap1()函数前: ";
echo "实参a=$variablea,实参b=$variableb
\n";
swap1($variablea,$variableb);
echo "调用swap1()函数后: ";
echo "实参a=$variablea,实参b=$variableb
\n";
?>
//上面的两个例子就是说明,求教了~~~
以上就介绍了presentationfontcache.exe