如何看待PHP Strict Standards錯誤_PHP教程

來源:互聯網
上載者:User
前天無意修改了php.ini關於錯誤輸出的設定,今天測試一個CakePHP開發的項目時竟然發現多了幾條錯誤提示,雖然不是致命的但也不能忽視。

錯誤的描述大概如下:www.2cto.com

Strict Standards: Redefining already defined constructor for class Object in D:\www\hosts\cake\ucake-libs\cake\libs\object.php on line 69

Strict Standards: Assigning the return value of new by reference is deprecated in D:\www\hosts\cake\ucake-libs\cake\libs\object.php on line 94

Strict Standards: Assigning the return value of new by reference is deprecated in D:\www\hosts\cake\ucake-libs\cake\libs\security.php on line 48

Strict Standards: Assigning the return value of new by reference is deprecated in D:\www\hosts\cake\ucake-libs\cake\libs\inflector.php on line 65

Strict Standards: Assigning the return value of new by reference is deprecated in D:\www\hosts\cake\ucake-libs\cake\libs\configure.php on line 89

Strict Standards: Non-static method Configure::getInstance() should not be called statically in D:\www\hosts\cake\ucake-libs\cake\bootstrap.php on line 43

Strict Standards: Non-static method Configure::write() should not be called statically in D:\www\hosts\cake\ucake-libs\cake\bootstrap.php on line 82

Strict Standards: Non-static method Configure::getInstance() should not be called statically in D:\www\hosts\cake\ucake-libs\cake\libs\configure.php on line 108

大概掃了幾眼,看到基本上是CakePHP架構的錯誤,在Google中搜尋相關錯誤資訊時發現其它架構也存在這種通病,無耐。。。

只好認真看了看錯誤的解釋,我理解的是:程式沒有按照PHP嚴格規定的模式編寫而給的警告。想到這點於是自己又測試了幾個以前寫的小程式,有的也會出現這個錯誤。看來以後自己得注意自己的編碼規範,不能一味的追求功能…

由於當前項目要進行調試,遂又將php.ini錯誤輸出重新定義為:error_reporting = E_ALL。將E_STRICT去掉了,重啟Apache…一切如常…

摘自 joy 's

http://www.bkjia.com/PHPjc/478506.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/478506.htmlTechArticle前天無意修改了php.ini關於錯誤輸出的設定,今天測試一個CakePHP開發的項目時竟然發現多了幾條錯誤提示,雖然不是致命的但也不能忽視。...

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.