mirror of
https://github.com/php/php-src.git
synced 2024-09-21 09:57:23 +00:00
MFH: Fixed bug#47981 (error handler not called regardless)
This commit is contained in:
parent
65640d2c1a
commit
0829cb89ee
19
Zend/tests/bug47981.phpt
Normal file
19
Zend/tests/bug47981.phpt
Normal file
@ -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()"
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user