Home  >  Article  >  Backend Development  >  关于PHP5.3访问ECSHOP系统_手机版本出错有关问题

关于PHP5.3访问ECSHOP系统_手机版本出错有关问题

WBOY
WBOYOriginal
2016-06-13 13:07:57786browse

关于PHP5.3访问ECSHOP系统_手机版本出错问题
今天用手机访问公司的商城系统
出现了此错误:Deprecated: Assigning the return value of new by reference is deprecated

错误原因与解决方案:

自从php5.3,越来越多的人会遇到“Assigning the return value of new by reference is deprecated in xxxx”这样的提示,尤其是在国外产品中(例如wordpress、joolma),很多人的解决办法很简单:把php版本换回就版本就ok了。毫无疑问这是个好办法,对这种遇到问题不求甚解的态度可能会让人看到些什么。我认为要换回php的旧版本,其实是对php技术爱好者的一种羞辱(用词不当,大致是这个意思)。解决办法:php5.3开始后,废除了php中的”=&”符号,所以要想复制,直接用=引用即可。

详细如下:
1、PHP5对象复制是采用引用的方式;
2、如果不采用引用方式,则需要在复制对象时加关键字 clone;
3、如果在复制的过程中,同时要变更某些属性,则增加函数_clone();

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn