Skip to content

Instantly share code, notes, and snippets.

@rfulwell
Created April 19, 2019 19:06
Show Gist options
  • Select an option

  • Save rfulwell/dcc46d4661197b836a9f357874de453d to your computer and use it in GitHub Desktop.

Select an option

Save rfulwell/dcc46d4661197b836a9f357874de453d to your computer and use it in GitHub Desktop.
A test file for use in comparing the behavior or `debug_backtrace` with a traditional debugger call stack.
<?php
// filename: a.php
// White space above was inserted to make debug_backtrace line numbers completely exclusive of each other.
class a_class
{
static function a_function($str)
{
echo "<pre>";
echo "#DB:debug_print_backtrace() running in [" . __FILE__ . ":" . __LINE__ . "]\n";
debug_print_backtrace();
echo "</pre>";
echo "<br>";
echo "</pre>";
print("<pre>".print_r(debug_backtrace(),true)."</pre>");
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment