`
congjl2002
  • 浏览: 211082 次
  • 性别: Icon_minigender_1
  • 来自: 辽宁
社区版块
存档分类
最新评论

PHP Strict Standards问题

 
阅读更多

异常信息:

( ! ) Strict standards: Declaration of SugarEmailAddress::save() should be compatible with that of SugarBean::save() in D:\dev\server\xampp1\htdocs\sugar\include\SugarEmailAddress\SugarEmailAddress.php on line 1011

Call Stack # Time Memory Function Location
1 0.0017 523432 {main}( ) ..\install.php:0
2 0.2274 7165168 require_once( 'D:\dev\server\xampp1\htdocs\sugar\include\entryPoint.php' ) ..\install.php:60

 

在运行PHP软件时,如果遇到类似的错误,“Strict Standards”,不是错误,而是PHP5.3和之前的版本不太兼容。5.3之后的版本规定声明需要在使用之前。

修改php.ini就可以解决,其实就是不显示出这个异常:

 

原php.ini
error_reporting = E_ALL | E_STRICT
 
修改为
error_reporting = E_ALL & ~E_NOTICE
 
分享到:
评论
1 楼 bill200711022 2013-02-05  
实测结果:就算把父类声明放在子类声明之后,也不会报错“Strict standards”,说明跟声明的相对位置是没有关系的。

<?php
// this code does NOT trigger a strict message
error_reporting( E_ALL | E_STRICT );

class cc extends c {
  function test() { return 2; }
}

class c {
  function test() { return 1; }
}

$cc = new cc();

echo $cc->test() . PHP_EOL;

看这个错误,和CodeGen_PECL报错声明错误一样,真正的原因应该是PHP5.3.0+开启严格错误检查时,当子类方法签名与父类方法签名不匹配时报"Strict standards"。

http://blog.csdn.net/bill200711022/article/details/8571056

相关推荐

    phpdocument Strict Standards 错误解决办法

    phpdocument 错误: ...Strict Standards:Only variables should be passed by reference in D:\xampp\php\pear\PhpDocumentor\phpDocumentor\Smarty-2.6.0\libs\Smarty_Compiler.class.php on line 712

    php 出现Strict Standards: Only variables should be passed by reference in的解决方法

    这个问题多半是因为引用传递参数引起的,解决办法一是修改代码不使用引用传递;另一个办法是修改php配置文件,修改error_reporting 其值改为error_reporting = E_ALL& ~E_NOTICE。或者修改函数中的引用方式即可。 ps...

    ecmall 兼容 php5.5以上版本

    在PHP5.5以上版本运行ecshop和ecmall出现的问题及解决方案

    Underscore.php——Underscore.js的php移植版

    注意:Underscore.php的原作者是老牌PHP程序员,其中使用静态调用方式访问非静态方法时php会提示Strict Standards: Non-static method的严谨性警告,不过只需要在php脚本的头部添加: error_reporting(E_ALL & ~E_...

    ecmall 兼容php5.5

    问题一:商城首页报错 Strict Standards: Only variables should be passed by reference in D:\wamp\ecshop\includes\cls_template.php on line 422 问题二:后台首页报错 Strict Standards: Non-static method cls...

    Openframeworks Graphics

    Openframeworks Graphics Introducing OpenGL for OF by Joshua Noble

    php函数传值的引用传递注意事项分析

    Strict standards: Only variables should be passed by reference 网上查到资料有这么一句话: 在php5.3以上版本会出这个问题,应该也和php的配置有关,只要把这一句拆成两句就没有问题了。因为array_walk的参数是...

    php.ini-development

    Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED ; Development Value: E_ALL ; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT ; html_errors ; Default Value: On ; Development Value: ...

    2016最新乐程旅游网源码方维内核二次开发版本

    修复 PHP Strict Standards: Only variables should be passed by reference in D:\wwwroot\system\template\template.php 403错误。 后台无法登陆或登陆无响应删除缓存文件即可~ 帐号:admin 密码:admin

    symfony-grumphp:使用大量用于静态代码分析的工具配置了GrumPHP

    : thecodingmachine/phpstan-strict-rules : symfony/phpunit-bridge 使用三叶草覆盖率和百分比代码覆盖率检查 : sensiolabs/security-checker 要求 PHP必须是PHP 7.2的最低版本。 Symfony Framework必须是...

Global site tag (gtag.js) - Google Analytics