Skip to content

Instantly share code, notes, and snippets.

@inso
Created June 20, 2017 08:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inso/49bb887a4228956ec1b05be6987f7c6b to your computer and use it in GitHub Desktop.
Save inso/49bb887a4228956ec1b05be6987f7c6b to your computer and use it in GitHub Desktop.
<?php
register_shutdown_function(function () {
file_put_contents(__DIR__ . '/tmp/stack_trace_' . uniqid('', true), var_export($GLOBALS['dbg_stack'], true));
});
register_tick_function(function () {
$GLOBALS['dbg_stack'] = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
});
declare(ticks=1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment