]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug#47981 (error handler not called regardless)
authorHannes Magnusson <bjori@php.net>
Thu, 16 Apr 2009 13:52:23 +0000 (13:52 +0000)
committerHannes Magnusson <bjori@php.net>
Thu, 16 Apr 2009 13:52:23 +0000 (13:52 +0000)
Zend/tests/bug47981.phpt [new file with mode: 0644]
Zend/zend_compile.c

diff --git a/Zend/tests/bug47981.phpt b/Zend/tests/bug47981.phpt
new file mode 100644 (file)
index 0000000..2d68d37
--- /dev/null
@@ -0,0 +1,19 @@
+--TEST--
+Bug #47981 (error handler not called regardless)
+--INI--
+error_reporting=0
+--FILE--
+<?php
+function errh($errno, $errstr) {
+       var_dump($errstr);
+}
+set_error_handler("errh");
+
+interface a{}
+class b implements a { function f($a=1) {}}
+class c extends b {function f() {}}
+?>
+--EXPECTF--
+string(62) "Declaration of c::f() should be compatible with that of b::f()"
+
+
index 8cce611e28195cb2dd8cda8ff5d6e5eeab7ca7a2..4b503c4905012588c0f2a48e5fdc62278318c049 100644 (file)
@@ -2135,7 +2135,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);
                }