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

我正在使用从torrenteditor获取的php脚本创建torrent文件,但是当我创建新的torrent文件时,使用指定的方法创建了torrent文件,但是我收到了很多通知.

在第319行的myfile.php中,应仅通过引用返回变量引用

在这条线上

return new BEncode_End();

被指定为另一个类

class BEncode_End

{

public function get_type()

{

return 'end';

}

}

那么我该如何解决此通知?

我上课很新,所以不知道从哪里开始.

我在用

ini_set('display_errors', 1);

error_reporting(E_ALL);

解决方法:

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;

应该解决你的问题.

标签:notice,php,e-notices

来源: https://codeday.me/bug/20191120/2041314.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值