Introduction
Using this library you can browse the content of complex variables, one nested level at the time by using commands such as zoomin, zoomout and exit. Currently, this class should only be used for command line applications. Web browsable functionality will be added later using through firephp/firebug.
Example
By executing the snippet below you will see the following screen. At this point you can decide to exit (or zoomout), or zoom in to nested variable links [1] and [2].
<?php
require_once("rawdev/RawDev.php");
require_once(RAWDEV_LIB.'/Util/Dumper.php');
class Test {
var $a='hi';
var $b = array(1, 2);
}
$complex = array(1, 'hi', array(99, 17), 'std' => new stdClass(), new Test(), array());
RDumper::dump($complex);
?>
If var_dump isn't enough, maybe you need an IDE with a debugger...
ReplyDelete@Richard: Really funny.
ReplyDeleteUnfortunately there are lots of people still stuck with the var_dump style of debugging. However, they try to evolve and beautify var_dumps.
when debug in browser, I thing firephp is a better choice.
ReplyDelete@@ thanks guys, IDE+command line dumper + firephp = complete set of tools
ReplyDelete-- I am also looking to expand RawDev with other XDebug functionality such as profiling.
Debug PHP code in an IDE in less than one hour. Using an IDE debugger in addition to RawDev's debugging tools will give you a comprehensive set of debugging tools.
http://blog.bokenkamp.com/2010/02/basic-open-source-ide-setup-for-php.html
This quick tutorial is targeted to Mac OS X and Linux but should be clear enough for other platforms.