From: Hannes Magnusson Date: Thu, 16 Apr 2009 13:48:01 +0000 (+0000) Subject: MFH: Fixed bug#47981 (error handler not called regardless) X-Git-Tag: php-5.3.0RC2~156 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0829cb89ee201e5dbb1fd37d4d595bdabf822506;p=php MFH: Fixed bug#47981 (error handler not called regardless) --- diff --git a/Zend/tests/bug47981.phpt b/Zend/tests/bug47981.phpt new file mode 100644 index 0000000000..2d68d3706f --- /dev/null +++ b/Zend/tests/bug47981.phpt @@ -0,0 +1,19 @@ +--TEST-- +Bug #47981 (error handler not called regardless) +--INI-- +error_reporting=0 +--FILE-- + +--EXPECTF-- +string(62) "Declaration of c::f() should be compatible with that of b::f()" + + diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index fd46e4d545..bee07b77a4 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -2631,7 +2631,7 @@ static zend_bool do_inherit_method_check(HashTable *child_function_table, zend_f if (!zend_do_perform_implementation_check(child, child->common.prototype)) { zend_error(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with that of %s::%s()", ZEND_FN_SCOPE_NAME(child), child->common.function_name, ZEND_FN_SCOPE_NAME(child->common.prototype), child->common.prototype->common.function_name); } - } else if (EG(error_reporting) & E_STRICT) { /* Check E_STRICT before the check so that we save some time */ + } else if (EG(error_reporting) & E_STRICT || EG(user_error_handler)) { /* Check E_STRICT (or custom error handler) before the check so that we save some time */ if (!zend_do_perform_implementation_check(child, parent)) { zend_error(E_STRICT, "Declaration of %s::%s() should be compatible with that of %s::%s()", ZEND_FN_SCOPE_NAME(child), child->common.function_name, ZEND_FN_SCOPE_NAME(parent), parent->common.function_name); }