Nice debug_backtrace() dump, with call and code preview

2.1.0 2021-05-16 16:56 UTC

This package is auto-updated.

Last update: 2024-02-16 23:06:02 UTC


version php Lines Total Downloads Scrutinizer


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

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



composer require --dev steevanb/php-backtrace ^2.1


// 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

Dump as HTML

// get backtrace dump as array
// get backtrace dump as HTML
// write getDump() HTML with echo
// write getDump() HTML with echo, and exit

HTML backtrace

Dump in symfony/console application

// Write dump
// Write dump and exit

Console backtrace