Download the PHP package hazardland/debug without Composer
On this page you can find all versions of the php package hazardland/debug. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hazardland/debug
More information about hazardland/debug
Files in hazardland/debug
Package debug
Short Description php variable debug
License MIT
Homepage http://github.com/hazardland/debug.php
Informations about the package debug
function debug ($object)
function debug (mixed $object, string/boolean $title=null, boolean/string $plain=false, integer $limit=6)
debug is a single function for visually analything / logging complex deep level objects and arrays.
Example of debug call html output:
Example of cli mode output
Or
Let us have an example classes (check ./demo/demo.php)
And intialize them in a following manner:
Now let us start debugging $test1. A simpliest call:
Will output following:
Note that object of class test3 is collapsed and only first property is visible you can unfold it by clicking + or you can just debug object with everything expanded by calling:
So now we see hidden parts of our object by default
Putting title on debug:
To have both expanded and titled debug we should just put * symbol in the begining of title string like this:
On a depth level 6 (considering starting level is 0) only ... is visible because of depth rendering limit which is by default 6. To unlock other levels we should incrase limit.
Third parameter is for plain text output if you pass true
It will output something like following indented with 4 space tabs:
To log plain text output in file just pass file path as a third parameter
And lastly if you are using subl-protocol plugin for sublime (https://github.com/thecotne/subl-protocol) you can unfold debug backtrace and with one click in browser jump on the specific file and line in sublime text editor:
To debug in error log use 'error_log' in 3d parameter:
` To view error log nicely formated use:
Or if you want all other error log messages:
`