天天看點

ecshop助理上傳報錯 無法連接配接伺服器:XML 文檔隻能有一個頂層元素。line2 <b> Deprecated</b>:Assignig the Deprecated</b>: 7510

無法連接配接伺服器:XML 文檔隻能有一個頂層元素。line2    <b>  Deprecated</b>:Assignig the  return

很多朋友的php程式當php的版本更新到5.3以後,會出現”Deprecated: Assigning the return value of new by reference is deprecated in“ 顯示出來。這是因為5.3以後,不能使用”=&”符号,可以直接用”=”就可以了。

是以當出現這個問題後有兩種解決方法:

1. 把php的版本降級到5.3以下,但後退的不是明智的選擇。

2.  對程式中”=&”符号全部用”=” 代替。

​​​ http://www.tulongzhiji.com/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

定位到出錯的那一行:

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

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

下面這段話引用于因思而變

解決辦法:php5.3開始後,廢除了php中的”=&”符号,是以要想複制,直接用=引用即可。詳細如下:

1、PHP5對象複制是采用引用的方式;

2、如果不采用引用方式,則需要在複制對象時加關鍵字 clone;

3、如果在複制的過程中,同時要變更某些屬性,則增加函數_clone();