PHP Debug is a single file API for tracing PHP applications.
You can add, with minimal impact, diagnostics to be displayed upon program termination. Each diagnostic contains file, function and caller function information as well.
Just an API, not a class. Just include the debug.php file and add
debug() calls throughout your code similar to
var_dump(). However, the diagnostic messages are stored and displayed as a list at program termination. The diagnostics can be disabled and controlled in other ways.
It's small and simple yet very versatile and includes demonstration/testing code.
Here is the PHP Debug code. There is a Go debug, and a Perl debug, to be here soon.
The exit diagnostic messages have file/function/line data. The file is supposed to have the DOCUMENT_ROOT removed (i.e. "/srv/www/htdocs"); however, running in some environments this gets screwed up – e.g. command line or in Visual Studio Code with "Launch currently open script". (The latter case has really weird
$_SERVER array data.)