diff options
Diffstat (limited to 'Zend/zend_builtin_functions.c')
| -rw-r--r-- | Zend/zend_builtin_functions.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index c0786f8ff3..3c4bce4e76 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -1537,9 +1537,8 @@ ZEND_FUNCTION(debug_print_backtrace) } /* }}} */ -/* {{{ proto void debug_backtrace(void) - Prints out a backtrace */ -ZEND_FUNCTION(debug_backtrace) + +ZEND_API void zend_fetch_debug_backtrace(zval *return_value TSRMLS_DC) { zend_execute_data *ptr; int lineno; @@ -1554,10 +1553,6 @@ ZEND_FUNCTION(debug_backtrace) int arg_stack_consistent = 0; int frames_on_stack = 0; - if (ZEND_NUM_ARGS()) { - ZEND_WRONG_PARAM_COUNT(); - } - while (--args >= EG(argument_stack).elements) { if (*args--) { break; @@ -1680,6 +1675,18 @@ ZEND_FUNCTION(debug_backtrace) /* }}} */ +/* {{{ proto array debug_backtrace(void) + Return backtrace as array */ +ZEND_FUNCTION(debug_backtrace) +{ + if (ZEND_NUM_ARGS()) { + ZEND_WRONG_PARAM_COUNT(); + } + + zend_fetch_debug_backtrace(return_value TSRMLS_CC); +} +/* }}} */ + /* {{{ proto bool extension_loaded(string extension_name) Returns true if the named extension is loaded */ ZEND_FUNCTION(extension_loaded) |
