Skip to content

Instantly share code, notes, and snippets.

@inso

inso/stack-trace.php

Created Jun 20, 2017
Embed
What would you like to do?
<?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
You can’t perform that action at this time.