]> granicus.if.org Git - php/commitdiff
Add an additional field $frame['object'] to the result array of debug_backtrace(...
authorSebastian Bergmann <sebastian@php.net>
Fri, 28 Oct 2005 20:08:25 +0000 (20:08 +0000)
committerSebastian Bergmann <sebastian@php.net>
Fri, 28 Oct 2005 20:08:25 +0000 (20:08 +0000)
NEWS
Zend/zend_builtin_functions.c

diff --git a/NEWS b/NEWS
index d207eeae887ba60ea35ec0201b45299ac4c928f6..73da6691eecd6539ec80d3984118808c9a48dc03 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -22,4 +22,7 @@ PHP                                                                        NEWS
   the part of haystack before or after first occurence of needle. (Johannes)
 - Added possibility to check in which extension an internal function was
   defined using reflection API. (Johannes)
+- Added an additional field $frame['object'] to the result array of
+  debug_backtrace() that contains a reference to the respective object when the
+  frame was called from an object. (Sebastian)
 - Fixed bug #34286 (__toString() behavior is inconsistent). (Marcus)
index 5967cfc5f2118862bdddaa15b8261e216369efaf..4027bdc2a2575772ecdf7dbae573a34be653c8f7 100644 (file)
@@ -2005,6 +2005,9 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last TSRML
                                        dup = zend_get_object_classname(ptr->object, &class_name, &class_name_len TSRMLS_CC);
                                        add_assoc_text_ex(stack_frame, "class", sizeof("class"), class_name, dup);
                                }
+                               add_assoc_zval_ex(stack_frame, "object", sizeof("object"), ptr->object);
+                               ptr->object->refcount++;
+
                                add_assoc_ascii_string_ex(stack_frame, "type", sizeof("type"), "->", 1);
                        } else if (ptr->function_state.function->common.scope) {
                                add_assoc_textl_ex(stack_frame, "class", sizeof("class"), ptr->function_state.function->common.scope->name, ptr->function_state.function->common.scope->name_length, 1);