根据文档,当您使用“调用时传递引用”时,将抛出E_DEPRECATED
但是,当我在命令行中运行以下代码时,没有错误或任何警告。
<?php
error_reporting(E_ALL);
echo PHP_VERSION, "\n"; // print 5.3.10-1ubuntu2ppa6~lucid
function test($string)
{
$string = 'bar';
}
$a = 'foo';
test(&$a);
echo $a; // print bar