博学而笃志 切问而近思 仁在其中
详情
Assigning the return value of new by reference is deprecated in
作者:Aliot     发布时间:2017-07-02     评论:0     阅读:1

Assigning the return value of new by reference is deprecated in

时间:2015-02-28

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

昨晚用Spreadsheet_Excel_Reader导入EXCEL内容到数据库的时候,出现了以下提示:

Deprecated: Assigning the return value of new by reference is deprecated in

定位到出错的那一行:

[php] view plaincopyprint?

$this->_ole =& new OLERead();

我本地环境用的是PHP/5.3.3。

解决办法:php5.3开始后,废除了php中的”=&”符号,所以要想复制,直接用=引用即可。详细如下:

1、PHP5对象复制是采用引用的方式;

2、如果不采用引用方式,则需要在复制对象时加关键字 clone;

3、如果在复制的过程中,同时要变更某些属性,则增加函数_clone();

更多精彩内容:http://www.bianceng.cn/webkf/PHP/


相关文章
loading......
最新动态
所有评论

loading......

网站声明:
本站部分内容来自网络,如您发现本站内容
侵害到您的利益,请联系本站管理员处理。
联系站长
373515719@qq.com
关于本站:
编程参考手册