codeigniter - 只有变量引用应该用引用返回 [英] Only variable references should be returned by reference - Codeigniter

查看:330
本文介绍了codeigniter - 只有变量引用应该用引用返回的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

服务器PHP升级后我得到的PHP版本5.6.2以下错误在Apache 2.0

After the server PHP upgrade I am getting the following error with PHP Version 5.6.2 on Apache 2.0

A PHP Error was encountered
Severity: Notice
Message: Only variable references should be returned by reference
Filename: core/Common.php
Line Number: 257

我该如何解决这个问题?

How can I fix this?

推荐答案

编辑文件名:核心/的common.php,行号:257

Edit filename: core/Common.php, line number: 257

return $_config[0] =& $config; 

$_config[0] =& $config;
return $_config[0]; 

更新

由NikiC添加

Update

Added by NikiC

在PHP分配前pressions总是返回分配的值。这样$ _config [0] =&放大器; $配置返回$配置 - 但不是变量本身,而是它的价值的一个副本。并返回到一个临时值的引用不会是特别有用的(改变它不会做任何事情)。

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).

此修复程序已合并到CI 2.2.1(<一个href=\"https://github.com/bcit-ci/$c$cIgniter/commit/69b02d0f0bc46e914bed1604cfbd9bf74286b2e3\">https://github.com/bcit-ci/$c$cIgniter/commit/69b02d0f0bc46e914bed1604cfbd9bf74286b2e3).这是更好地升级,而不是修改核心框架的文件。

This fix has been merged into CI 2.2.1 (https://github.com/bcit-ci/CodeIgniter/commit/69b02d0f0bc46e914bed1604cfbd9bf74286b2e3). It's better to upgrade rather than modifying core framework files.

这篇关于codeigniter - 只有变量引用应该用引用返回的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆