Tec*_*hie 164 php apache codeigniter apache2 codeigniter-2
服务器PHP升级后,我在Apache 2.0上使用PHP Version 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
Run Code Online (Sandbox Code Playgroud)
我怎样才能解决这个问题?
Tec*_*hie 432
编辑文件名:core/Common.php,行号:257
之前
return $_config[0] =& $config;
Run Code Online (Sandbox Code Playgroud)
后
$_config[0] =& $config;
return $_config[0];
Run Code Online (Sandbox Code Playgroud)
由NikiC添加
在PHP赋值表达式中,始终返回指定的值.所以$ _config [0] =&$ config返回$ config - 但不是变量本身,而是它的值的副本.返回对临时值的引用不会特别有用(更改它不会做任何事情).
此修复已合并到CI 2.2.1(https://github.com/bcit-ci/CodeIgniter/commit/69b02d0f0bc46e914bed1604cfbd9bf74286b2e3).最好是升级而不是修改核心框架文件.
San*_*anu 10
更改core/Common.php行号:257代码
$_config[0] =& $config;
return $_config[0];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
269847 次 |
| 最近记录: |