summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2005-03-07 19:28:10 +0000
committerMarcus Boerger <helly@php.net>2005-03-07 19:28:10 +0000
commit6f00c1b73befbfb95dc28785acbe001e65445d6a (patch)
treed9af58189d7c385712d3a0b8474ad8d93a709cd2
parent118b7b567a43612ad08a61d2f0b579f2f18f6c54 (diff)
downloadphp-git-6f00c1b73befbfb95dc28785acbe001e65445d6a.tar.gz
- Fix #32226
-rwxr-xr-xZend/tests/bug32226.phpt36
-rw-r--r--Zend/zend_builtin_functions.c2
2 files changed, 37 insertions, 1 deletions
diff --git a/Zend/tests/bug32226.phpt b/Zend/tests/bug32226.phpt
new file mode 100755
index 0000000000..b440bc5d6b
--- /dev/null
+++ b/Zend/tests/bug32226.phpt
@@ -0,0 +1,36 @@
+--TEST--
+Bug # 32226
+--FILE--
+<?
+
+class A
+{
+ public function A()
+ {
+ set_exception_handler(array($this, 'EH'));
+
+ throw new Exception();
+ }
+
+ public function EH()
+ {
+ restore_exception_handler();
+
+ throw new Exception();
+ }
+}
+
+try
+{
+$a = new A();
+}
+catch(Exception $e)
+{
+ echo "Caught\n";
+}
+
+?>
+===DONE===
+--EXPECT--
+Caught
+===DONE===
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index 482042483a..fa01ba5fc8 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -1753,7 +1753,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last TSRML
if (function_name) {
add_assoc_string_ex(stack_frame, "function", sizeof("function"), function_name, 1);
- if (ptr->object) {
+ if (ptr->object && Z_TYPE_P(ptr->object) == IS_OBJECT) {
class_name = Z_OBJCE(*ptr->object)->name;
call_type = "->";
} else if (ptr->function_state.function->common.scope) {