解决php5.3中Deprecated: Assigning the return value of new by re
更新时间:2014-07-13 点击量:1682
今天一个客户的网站出现了Deprecated: Assigning the return value of new by reference is deprecated in wwwroot\common.inc.php on line 23的错误。看了下之后定位到common.inc.php的文件找到23行,因为我们现在php是5.3的原因,在php5.3之中可以直接用”=”,而之前因为在本地上测试都是5.3以下的php环境用的是”=&”符号。
在5.3版本之后已经不允许在程序中使用”=&”符号。如果你的网站出现了Deprecated: Assigning the return value of new by reference is deprecated in 错误,别着急,先定位到出错的文件,查找下是不是在程序中使用了”=&”,例如阿兹猫刚才定位到网站程序中发现了下图的程序,发现使用了”=&”符号,去掉‘&’符号之后程序运行正常。
如果文章对您有帮助,就打赏一个吧