搜索
首页php教程php手册如何看待PHP Strict Standards错误

如何看待PHP Strict Standards错误

Jun 13, 2016 am 10:46 AM
phpphp.ini修改关于如何输出错误

 

前天无意修改了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

声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

Video Face Swap

Video Face Swap

使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章

热工具

SublimeText3 英文版

SublimeText3 英文版

推荐:为Win版本,支持代码提示!

EditPlus 中文破解版

EditPlus 中文破解版

体积小,语法高亮,不支持代码提示功能

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

功能强大的PHP集成开发环境

安全考试浏览器

安全考试浏览器

Safe Exam Browser是一个安全的浏览器环境,用于安全地进行在线考试。该软件将任何计算机变成一个安全的工作站。它控制对任何实用工具的访问,并防止学生使用未经授权的资源。

VSCode Windows 64位 下载

VSCode Windows 64位 下载

微软推出的免费、功能强大的一款IDE编辑器