Heim  >  Artikel  >  Backend-Entwicklung  >  PHP错误Deprecated: Assigning the return value of new_PHP教程

PHP错误Deprecated: Assigning the return value of new_PHP教程

WBOY
WBOYOriginal
2016-07-13 16:56:57958Durchsuche

今天把php升级到php5.3之后出现在使用 =& 时提示PHP错误Deprecated: Assigning the return value of new by reference is deprecated in了,后来找了一些才发php5.3不支持=&了。

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

错误行:$mysql =& new mysql;

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

解决办法:

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

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/631548.htmlTechArticle今天把php升级到php5.3之后出现在使用 =了。 Deprecated: Assigning the return value of new by reference is deprecated in的解决办法: 错误行:$mysql = new mysql...
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn