summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfoobar <sniper@php.net>2003-05-21 21:42:25 +0000
committerfoobar <sniper@php.net>2003-05-21 21:42:25 +0000
commitbec958114b43194413c3ac92a763228d0176ff94 (patch)
treeea735681e89360f1df0960f4cf9acd5ce66854b8
parentaf5e2af752c6fca01688cdb8b9a34ec698d931ba (diff)
downloadphp-git-bec958114b43194413c3ac92a763228d0176ff94.tar.gz
Fixed bug #23619 (set_error_handler() registered handler not called for object instances). (Jani, waboring@qualys.com)
-rw-r--r--Zend/zend_builtin_functions.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index 69921a1d60..b458724815 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -1027,11 +1027,17 @@ ZEND_FUNCTION(set_error_handler)
}
ALLOC_ZVAL(EG(user_error_handler));
- if (Z_STRLEN_PP(error_handler)==0) { /* unset user-defined handler */
- FREE_ZVAL(EG(user_error_handler));
- EG(user_error_handler) = NULL;
- RETURN_TRUE;
- }
+#ifdef JANI_0
+ /*
+ * This part would never be reached unless there is something
+ * wrong with the engine as empty string can not be valid call back.
+ * See bug #23619 for more information why this is left here.
+ * (this only applies to non-debug-builds.)
+ */
+ if (Z_STRLEN_PP(error_handler)==0) { /* unset user-defined handler */
+ zend_error(E_ERROR, "%s(): This should never happen! '%s'", get_active_function_name(TSRMLS_C), error_handler);
+ }
+#endif
*EG(user_error_handler) = **error_handler;
zval_copy_ctor(EG(user_error_handler));