出现 Assigning the return value of new by reference is deprecated in xxxx &&“Warning: Call-time pass-by-reference has been 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();

http://blog.csdn.net/shimch/article/details/630158

http://www.liuhuadong.com/archives/904

出现 Assigning the return value of new by reference is deprecated in xxxx &&“Warning: Call-time pass-by-reference has been deprecated”怎么办?

时间: 2024-08-02 03:14:58

出现 Assigning the return value of new by reference is deprecated in xxxx &&“Warning: Call-time pass-by-reference has been deprecated”怎么办?的相关文章

ECShop后台站点地图关于 Deprecated: Assigning the return value of new by reference is deprecated的错误的解决办法

今天对后台系统进行一些简单的操作,当点击  系统设置---站点地图  时发现提示: Deprecated: Assigning the return value of new by reference is deprecated 的错误,如下图: 起先以为是代码的问题,可是一想到这个模板是官网的默认模板,对sitemap.php文件进行查找后未能发现问题.后来将错误内容从网上一查找,原来是由于从php5.3开始后,废除了php中的"=&"符号,所以删除&符号即可. 删除

zencart 显示Deprecated: Assigning the return value of new by reference is deprecated

很多朋友的php程序当php的版本升级到5.3以后,会出现"Deprecated: Assigning the return value of new by reference is deprecated in"显示出来.这是因为5.3以后,不能使用"=&"符号,可以直接用"="就可以了. 所以当出现这个问题后有两种解决方法: 1.把php的版本降级到5.3以下,但后退的不是明智的选择. 2.对程序中"=&"符

显示Deprecated: Assigning the return value of new by reference is deprecated in解决办法

很多朋友的php程序当php的版本升级到5.3以后,会出现”Deprecated: Assigning the return value of new by reference is deprecated in“ 显示出来.这是因为5.3以后,不能使用”=&”符号,可以直接用”=”就可以了. 所以当出现这个问题后有两种解决方法: 1. 把php的版本降级到5.3以下,但后退的不是明智的选择. 2. 对程序中”=&”符号全部用”=” 代替.

PHP 解决版本问题:"Assigning the return value of new by reference is deprecated"

问题描述:     在最近使用ECSHOP v273帮客户建立了一个商城系统,商城搭建一切ok但在使用中后台发现了一个500错误 在服务器上访问该地址发现了错误信息:"Assigning the return value of new by reference is deprecated" 然后通过源码发现了问题所在,原因是在PHP5.3以后就废除了"=&"符号 解决方案: 去掉&符号直接使用=即可 参考: ASSIGNING THE RETURN

《Effective C++》资源管理:条款20-条款21

条款20:宁以pass-by-reference-to-const替换pass-by-value 在默认情况下,C++函数传递参数是继承C的方式,是值传递(pass by value).这样传递的都是实际实参的副本,这个副本是通过调用复制构造函数来创建的.有时候创建副本代价非常昂贵.例如一下继承体系 class Person{ public: Person(); virtual ~Person(); -- private: std::string name; std::string addres

php面试题之三——PHP语言基础(基础部分)

1. strlen( )与 mb_strlen( )的作用分别是什么(新浪网技术部) strlen和mb_strlen都是用于获取字符串长度. strlen只针对单字节编码字符,也就是说它计算的是字符串的总字节数.如果是多字节编码,如 gbk 和 utf-8,使用 strlen 得到是该字符的总字节数: 可以使用mb_strlen获取其字符个数,使用mb_strlen 要注意两点,一是要开启 mbstring 扩展,二是要指定字符集. 总结: strlen函数不管是字符串是单字节编码还是多字节编

JNI Local Reference Changes in ICS

[This post is by Elliott Hughes, a Software Engineer on the Dalvik team. — Tim Bray] If you don’t write native code that uses JNI, you can stop reading now. If you do write native code that uses JNI, you really need to read this. What’s changing, and

[C++]关于接口的设计与声明--对封装性的理解

设计与声明 所谓软件设计,是"令软件做出你希望它做的事情"的步骤和方法,通常以颇为一般性的构想开始,最终十足的细节,以允许特殊接口(interface)的开发.这些接口而后必须转换为C++声明式.本文讨论对良好C++接口的设计和声明. 1. 让接口容易被正确使用,不易被误用 C++拥有许多的接口,function接口,class接口,template接口-.每一种接口实施客户与你的代码互动的手段.理想情况下,客户总是会准确的使用你的接口并获得理想的结果,而如果客户错误的使用了接口,代码

[C++] Variables and Basic Types

Getting Started compile C++ program source $ g++ -o prog grog1.cc run C++ program $ ./prog The library, iostream, define four IO object: cin, cout, cerr, clog. std::cout << "hello world" << std::endl; The result of the output operato