error_reporting(E_ALL);
sweep ($ignore, $ignore);
// no errors occur here
sweep($a=1,$b=1);
/**
程序设计处理,
1 在使用了引用的参数,传递一个为null的参数, 在函数内部如果重新给参数赋值, 则以内部赋值结果为准
2 如果参数被定义为引用, 在函数内部如果有重新赋值, 则在此程序后, 被使用的参数,都会永久变更为函数内赋值的新值.
3 在开启了捕获所有错误信息的开关后, 如果对引用参数,传递了临时变量, 则会出现错误.
**/
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