在服务器PHP升级后,我在Apache 2.0 上的PHP版本5.6.2出现以下错误
A PHP Error was encountered
Severity: Notice
Message: Only variable references should be returned by reference
Filename: core/Common.php
Line Number: 257
我该怎么解决这个问题?
编辑文件名:core/Common.php,行号:257
之前
return $_config[0] =& $config;
之后
$_config[0] =& $config;
return $_config[0];
更新
由NikiC 添加
在PHP中,赋值表达式总是返回赋值。因此$_config[0]=&config返回$config,但不是变量本身,而是其值的副本。返回对临时值的引用并不是特别有用(更改它不会有任何作用)。
更新
此修复程序已合并到CI 2.2.1中(https://github.com/bcit-ci/CodeIgniter/commit/69b02d0f0bc46e914bed1604cfbd9bf74286b2e3)。与其修改核心框架文件,不如升级。
这在codeigniter 2.2.1中进行了修改……通常不是修改核心文件的最佳实践,我总是会检查更新,2.2.1在2015年1月发布
重写codeigniter的core.common文件不是更好的主意。因为这是经过更多测试的系统文件。。。。
我想办法解决这个问题。在您的ckeditor_helper.php文件中线路-65
if($k !== end (array_keys($data['config']))) {
$return .= ",";
}
将其更改为-->
$segment = array_keys($data['config']);
if($k !== end($segment)) {
$return .= ",";
}
我认为这是最好的解决方案,然后你的问题通知就会消失。