Download the PHP package gajus/bugger without Composer
On this page you can find all versions of the php package gajus/bugger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package bugger
Short Description Bugger is a collection of functions for debugging PHP code.
License BSD-3-Clause
Homepage https://github.com/gajus/bugger
Informations about the package bugger
Bugger
Bugger is a collection of functions for debugging PHP code. Use it to:
- Dump information about a variable
- Set breakpoints in loops
Bugger is designed to be used when remote debugger is not available. It allows to dump information about a variable together with the debug backtrace (trace
method), it allows to collect information about multiple variables during the script execution and dump them at the end of the script execution (stack
method), as well as trap iterations (tick
method).
API
Bugger API is exposed to the global namespace via three functions:
Trace
`
Trace is used to dump information about the expression including the backtrace information. Trace will attempt to discard existing output buffer. If output buffer cannot be discaded because it has been already sent to the browser, then Bugger will attempt to clear the previous output using client-side script.
Stack
Stack is identical to trace
except that calling stack
will not terminate the script at the time of the call. If stack
is called at least once during the script execution, then at the end of the script execution output buffer will be discarded and replaced with the collected stack
dump, e.g.
In the above example, 'foo', 'bar', 'baz' and 'qux' will be discarded.
Tick
tick
is used to catch script execution in loop or recursive calls. tick
returns true
when it has been executed a predefined number of times or more, e.g.
tick
can be used together with stack
or trace
to capture the state of a particular itteration or multiple itterations.
Installation
The recommended way to use Bugger is through Composer.
If you want to use Bugger across the server, then use auto_prepend_file setting to load ./src/autoload.php
.
Roadmap
- Support CLI.