php 函数参数 引用,php 函数参数的引用
error_reporting(E_ALL);
sweep ($ignore, $ignore);
// no errors occur here
sweep($a=1,$b=1);
/**
程序設(shè)計處理,
1 在使用了引用的參數(shù),傳遞一個為null的參數(shù), 在函數(shù)內(nèi)部如果重新給參數(shù)賦值, 則以內(nèi)部賦值結(jié)果為準
2 如果參數(shù)被定義為引用, 在函數(shù)內(nèi)部如果有重新賦值, 則在此程序后, 被使用的參數(shù),都會永久變更為函數(shù)內(nèi)賦值的新值.
3 在開啟了捕獲所有錯誤信息的開關(guān)后, 如果對引用參數(shù),傳遞了臨時變量, 則會出現(xiàn)錯誤.
**/
function sweep ( &$filecount, &$bytecount ) {
var_dump($filecount,$bytecount);
$filecount = 1;
$bytecount = 1024;
print "Files: $filecount - Size: $bytecount";
// prints "Files: 1024 - Size: 1024"
}
// output
---------- php ----------
NULL
NULL
Files: 1024 - Size: 1024
Strict Standards: Only variables should be passed by reference in D:\phpStudy\WWW\demo\fun_argc_refresh.php on line 6
Strict Standards: Only variables should be passed by reference in D:\phpStudy\WWW\demo\fun_argc_refresh.php on line 6
int(1)
int(1)
Files: 1 - Size: 1024PHP Strict Standards: Only variables should be passed by reference in D:\phpStudy\WWW\demo\fun_argc_refresh.php on line 6
PHP Strict Standards: Only variables should be passed by reference in D:\phpStudy\WWW\demo\fun_argc_refresh.php on line 6
Output completed (0 sec consumed) - Normal Termination
總結(jié)
以上是生活随笔為你收集整理的php 函数参数 引用,php 函数参数的引用的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: php post处理,PHP处理GETP
- 下一篇: php运行资源库,如何在sublime上