From a563e4224dbb88d9237a4928bc4d6f8826371d4b Mon Sep 17 00:00:00 2001 From: Hannes Magnusson Date: Thu, 16 Apr 2009 13:47:25 +0000 Subject: [PATCH] Fixed bug#47981 (error handler not called regardless) --- Zend/tests/bug47981.phpt | 19 +++++++++++++++++++ Zend/zend_compile.c | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 Zend/tests/bug47981.phpt diff --git a/Zend/tests/bug47981.phpt b/Zend/tests/bug47981.phpt new file mode 100644 index 0000000000..789ed89bf4 --- /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-- +unicode(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 b32a0930f7..3fbc529a1a 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -2722,7 +2722,7 @@ static zend_bool do_inherit_method_check(HashTable *child_function_table, zend_f if (!zend_do_perform_implementation_check(child, child->common.prototype TSRMLS_CC)) { zend_error(E_COMPILE_ERROR, "Declaration of %v::%v() must be compatible with that of %v::%v()", 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 TSRMLS_CC)) { zend_error(E_STRICT, "Declaration of %v::%v() should be compatible with that of %v::%v()", ZEND_FN_SCOPE_NAME(child), child->common.function_name, ZEND_FN_SCOPE_NAME(parent), parent->common.function_name); } -- 2.50.1