我正在使用从torrenteditor获取的PHP脚本创建torrent文件,但是当我创建新的torrent文件时,使用指定的方法创建了torrent文件,但是我收到了很多通知.
在第319行的myfile.PHP中,应仅通过引用返回变量引用
在这条线上
return new BEncode_End();
被指定为另一个类
class BEncode_End
{
public function get_type()
{
return 'end';
}
}
我上课很新,所以不知道从哪里开始.
完整的脚本/代码在这里上传http://pastebin.com/L6ktvrne,第319行
我在用
ini_set('display_errors', 1);
error_reporting(E_ALL);
解决方法:
根据您收到的通知以及answer to another related question:
In PHP assignment expressions always return the assigned value. So
$_config[0] =& $config returns $config – but not the variable itself,
but a copy of its value. And returning a reference to a temporary
value wouldn’t be particularly useful (changing it wouldn’t do
anything).
从以下位置更改代码:
return new BEncode_End();
至:
$cl = new BEncode_End();
return $cl;
应该解决你的问题.