解决php5.3中Deprecated: Assigning the return value of new by reference is deprecated in报错

来源:互联网 发布:网络发帖能查到吗 编辑:程序博客网 时间:2024/05/16 07:37

解决php5.3中Deprecated: Assigning the return value of new by reference is deprecated in报错
字体大小: 小 中 大 作者: pudding1998 | 分类: IOS和开发 | 浏览: 3899| 2012年2月29日     今天一个客户的网站出现了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 错误,别着急,先定位到出错的文件,查找下是不是在程序中使用了”=&”,例如阿兹猫刚才定位到网站程序中发现了下图的程序,发现使用了”=&”符号,去掉‘&’符号之后程序运行正常。
本文来源于阿兹猫博客  http://www.yangyin1989.com/ , 原文地址:http://www.yangyin1989.com/post/php53-Deprecated.html 


0 0