Show nice equivalent to debug_backtrace(), with caller, code preview etc.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
DebugBacktrace.php
DebugBacktraceConsole.php
DebugBacktraceHtml.php
README.md
backtrace_console.jpg
backtrace_html.png
changelog.md
composer.json

README.md

version php Lines Total Downloads SensionLabsInsight Scrutinizer

php-backtrace

Show nice equivalent to debug_backtrace(), with caller, code preview etc.

Can be used in HTML, or with symfony/console.

Changelog

Installation

composer require-dev steevanb/php-backtrace ^2.0

Configuration

// configure how file paths will be shown
// true : remove path prefix, based on DumpBacktrace.php path (assume it is in vendor/ dir)
// false : do not remove anything in file paths
// string : remove this prefix
\DumpBacktrace::setRemovePathPrefix($remove);

Dump as HTML

// get backtrace dump as array
\DebugBacktraceHtml::getBacktraces($offset = 0, $limit = null);
// get backtrace dump as HTML
\DebugBacktraceHtml::getDump($offset = 0, $limit = null);
// write getDump() HTML with echo
\DebugBacktraceHtml::dump($offset = 0, $limit = null);
// write getDump() HTML with echo, and exit
\DebugBacktraceHtml::eDump($offset = 0, $limit = null);

HTML backtrace

Dump in symfony/console application

// write dump in $output
\DebugBacktraceConsole::dump(OutputInterface $output, $offset = 0, $limit = null);
// write dump in $output, and exit
\DebugBacktraceConsole::eDump(OutputInterface $output, $offset = 0, $limit = null);

Console backtrace