php-如何修复注意:在引用中,只应返回变量引用

我正在使用从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;

应该解决你的问题.

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...