很多站长朋友们都不太清楚phpe_strict,今天小编就来给大家整理phpe_strict,希望对各位有所帮助,具体内容如下:
本文目录一览: 1、 现在发起一个抢答:题目是,PHP声明变量用什么符号定义? 2、 我安装ECMall后报PHP Strict Standards错误,请问如何解决 3、 linux下编写php怎么提示语法错误 4、 如何看待PHP Strict Standards错误 现在发起一个抢答:题目是,PHP声明变量用什么符号定义?php声明和调用变量的符号主要是var_dump(property_exists($c,'d'));//bool(true)。
如果对一个未定义的变量进行引用赋值、引用参数传递或引用返回,则会自动创建该变量。
同样的语法可以用在函数中,它返回引用,以及用在new运算符中(PHP4.0.4以及以后版本)。
自PHP5起,new自动返回引用,因此在此使用=已经过时了并且会产生E_STRICT级别的消息。
运行代码是让$b来引用$a的内容,然后改变$a的内容,$b的内容也会随之变化。具体的标识符包括$a,$b,$c。
我安装ECMall后报PHP Strict Standards错误,请问如何解决异常:Strict Standards: Non-static method ECMall::startup() should not be called statically in /htdocs/ecmall/index.php on line 22
Deprecated: Assigning the return value of new by reference is
deprecated in /htdocs/ecmall/eccore/controller/app.base.php on line 141
Deprecated: Assigning the return value of new by reference is deprecated in /htdocs/ecmall/includes/ecapp.base.php on line 137
Strict Standards: Declaration of FrontendApp::jslang() should be
compatible with ECBaseApp::jslang($lang) in
/htdocs/ecmall/app/frontend.base.php on line 363
Strict Standards: Declaration of Message::display() should be
compatible with BaseApp::display($n) in
/htdocs/ecmall/eccore/controller/message.base.php on line 329
等类似错误提示的时候(PHP5.2.*版本的同样有这情况),可以考虑我们下面给出的解决方法:
1)问题分析:该错误是PHP环境配置的问题,并非程序问题;
2)找到php.ini 文件,将 error_reporting 的值改为:error_reporting = E_ALL ~E_NOTICE
或者xmapp中修改值为:E_ALL ~E_DEPRECATED ~E_STRICT
3)重启Apache或者IIS。
4)完毕
linux下编写php怎么提示语法错误可以如下:
ini_set("display_errors", "On");
error_reporting(E_ALL | E_STRICT);
当然,如果能够修改php.ini的话,如下即可:
display_errors = On
error_reporting = E_ALL ~E_NOTICE
如何看待PHP Strict Standards错误前天无意修改了php.ini关于错误输出的设置,今天测试一个CakePHP开发的项目时竟然发现多了几条错误提示,虽然不是致命的但也不能忽视。
错误的描述大概如下
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…一切如常…
关于phpe_strict的介绍到此就结束了,不知道本篇文章是否对您有帮助呢?如果你还想了解更多此类信息,记得收藏关注本站,我们会不定期更新哦。
查看更多关于关于phpe_strict的信息的详细内容...