PHP – Nice Debug Trace

<?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;
}
?>

This entry was posted in PHP. Bookmark the permalink.

Leave a Reply