note 85915 modified in function.debug-backtrace by danbrown
| From: | danbrown@php.net | Date: | Wed, 24 Sep 2008 14:35:48 +0000 |
| Subject: | note 85915 modified in function.debug-backtrace by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-144669@lists.php.net to get a copy of this message | ||
I think I worked out an easy way to get the trace printed out in an easily readable format with
minimal code:
<?php
echo parse_backtrace(debug_backtrace());
function parse_backtrace($raw){
$output="";
foreach($raw as $entry){
$output.="\nFile: ".$entry['file']." (Line:
".$entry['line'].")\n";
$output.="Function: ".$entry['function']."\n";
$output.="Args: ".implode(", ", $entry['args'])."\n";
}
return $output;
}
?>
--was--
I think I worked out an easy way to get the trace printed out in an easily readable format with
minimal code:
<?
echo parse_backtrace(debug_backtrace());
function parse_backtrace($raw){
$output="";
foreach($raw as $entry){
$output.="\nFile: ".$entry['file']." (Line:
".$entry['line'].")\n";
$output.="Function: ".$entry['function']."\n";
$output.="Args: ".implode(", ", $entry['args'])."\n";
}
return $output;
}
?>
http://php.net/manual/en/function.debug-backtrace.php