PHP錯誤Deprecated: Assigning the return value of new_PHP教程

來源:互聯網
上載者:User
今天把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();

http://www.bkjia.com/PHPjc/631548.htmlwww.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...

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.