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

Assigning the return value of new by reference is deprecated in

編輯:PHP綜合

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();

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