@@ -2194,6 +2194,7 @@ ZEND_FUNCTION(debug_print_backtrace)
2194
2194
ZEND_API void zend_fetch_debug_backtrace (zval * return_value , int skip_last , int options , int limit TSRMLS_DC )
2195
2195
{
2196
2196
zend_execute_data * ptr , * skip ;
2197
+ zend_function * fbc ;
2197
2198
int lineno , frameno = 0 ;
2198
2199
const char * function_name ;
2199
2200
const char * filename ;
@@ -2260,14 +2261,26 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
2260
2261
filename = NULL ;
2261
2262
}
2262
2263
2263
- function_name = ptr -> function_state .function -> common .function_name ;
2264
+ fbc = ptr -> function_state .function ;
2265
+ function_name = fbc -> common .function_name ;
2264
2266
2265
2267
if (function_name ) {
2266
- add_assoc_string_ex (stack_frame , "function" , sizeof ("function" ), (char * )function_name , 1 );
2268
+ if (IS_ACCESSOR_FN (fbc )) {
2269
+ add_assoc_string_ex (
2270
+ stack_frame , "property" , sizeof ("property" ),
2271
+ zend_get_accessor_name_from_function (fbc TSRMLS_CC ), 1
2272
+ );
2273
+ add_assoc_string_ex (
2274
+ stack_frame , "accessor" , sizeof ("accessor" ),
2275
+ zend_fn_purpose_string (fbc ), 1
2276
+ );
2277
+ } else {
2278
+ add_assoc_string_ex (stack_frame , "function" , sizeof ("function" ), (char * )function_name , 1 );
2279
+ }
2267
2280
2268
2281
if (ptr -> object && Z_TYPE_P (ptr -> object ) == IS_OBJECT ) {
2269
- if (ptr -> function_state . function -> common .scope ) {
2270
- add_assoc_string_ex (stack_frame , "class" , sizeof ("class" ), (char * )ptr -> function_state . function -> common .scope -> name , 1 );
2282
+ if (fbc -> common .scope ) {
2283
+ add_assoc_string_ex (stack_frame , "class" , sizeof ("class" ), (char * ) fbc -> common .scope -> name , 1 );
2271
2284
} else {
2272
2285
zend_uint class_name_len ;
2273
2286
int dup ;
@@ -2282,8 +2295,8 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
2282
2295
}
2283
2296
2284
2297
add_assoc_string_ex (stack_frame , "type" , sizeof ("type" ), "->" , 1 );
2285
- } else if (ptr -> function_state . function -> common .scope ) {
2286
- add_assoc_string_ex (stack_frame , "class" , sizeof ("class" ), (char * )ptr -> function_state . function -> common .scope -> name , 1 );
2298
+ } else if (fbc -> common .scope ) {
2299
+ add_assoc_string_ex (stack_frame , "class" , sizeof ("class" ), (char * )fbc -> common .scope -> name , 1 );
2287
2300
add_assoc_string_ex (stack_frame , "type" , sizeof ("type" ), "::" , 1 );
2288
2301
}
2289
2302
0 commit comments