从
Passing By Reference文档页面:
You can pass a variable by reference
to a function so the function can
modify the variable. The Syntax is as
follows:
<?PHP function foo(&$var) { $var++; } $a=5; foo($a); // $a is 6 here ?>
…In recent versions of PHP you will get a warning saying that “call-time pass-by-reference” is deprecated when you use & in foo(&$a);