Let debug_backtrace() example print out the class name, if applicable, and the function/method arguments.

This commit is contained in:
Sebastian Bergmann 2002-09-04 05:35:20 +00:00
parent 38ef35e5b0
commit 7d85d01834

View File

@ -510,11 +510,22 @@ Changes in the Zend Engine 2.0
$backtrace = debug_backtrace();
foreach ($backtrace as $step) {
$class = isset($step['class']) ? $step['class'] . '::' : '';
if (!empty($step['args'])) {
foreach ($step['args'] as $arg) {
$args = isset($args) ? $args . ', ' : '';
$args .= var_export($arg, true);
}
} else {
$args = '';
}
$args = str_replace("\n", '', $args);
printf(
"%s [%s:%s]\n",
"%s%s(%s) [%s:%s]\n",
isset($step['class']) ? $step['class'] . '::' : '',
$step['function'],
$args,
$step['file'],
$step['line']
);