程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 網頁編程 >> PHP編程 >> 關於PHP編程 >> PHP錯誤Deprecated: Assigning the return value of new

PHP錯誤Deprecated: Assigning the return value of new

編輯:關於PHP編程

今天把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();

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved