Skip to content

Instantly share code, notes, and snippets.

View topicus's full-sized avatar

Mariano Carballal topicus

View GitHub Profile
@eddieajau
eddieajau / debug.php
Created May 10, 2012 05:18
Printing a clean debug backtrace in PHP.
// PHP < 5.3.6
foreach (debug_backtrace() as $trace)
{
echo sprintf("\n%s:%s %s::%s", $trace['file'], $trace['line'], $trace['class'], $trace['function']);
}
die;
// PHP >= 5.3.6
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
die;