PHP错误Deprecated: Assigning the return value of new by reference is deprecated in的解决办法

PHP错误Deprecated: Assigning the return value of new by reference is deprecated in的解决办法:

错误行:$mysql =& new mysql;

错误原因:php5.3开始后,废除了php中的”=&”符号

解决办法:
      要想复制,直接用=引用即可。详细如下:

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

本博客所有文章如无特别注明均为原创。作者:ok12复制或转载请以超链接形式注明转自 成功志
原文地址《PHP错误Deprecated: Assigning the return value of new by reference is deprecated in的解决办法
分享到:更多

相关推荐

发表评论

路人甲 表情
看不清楚?点图切换 Ctrl+Enter快速提交

网友评论(0)