PHP utility for tracing and displaying objects
Function and purpose
dump is just a way of dumping complex objects and arrays, showing the stack
and tracing execution. Think of it as a much better version of print_r() with
tweakable features to let you see needles in haystacks by using a colour-coded display. It can write to
the screen or a separate file or files.
Two example PHP programs All in new windows
print(dump::Value($object1),'What object 1 looks like');
... somewhere deeply nested
dump::Trace('STACK'); // will list complex arguments
... at a convenient place
- Download package from vulpeculox.net. DOWNLOAD NOW
- Unzip somewhere
- Run the example .php files to see dump in operation
- Move dump.php (and check.php while you're at it although it isn't required)
into your PHP path. Run the example programs again to test.
- Have a browse of the comments in exercise_dump_trace.php
and compare with the results.
- Become familiar with the way dump tends to buffer results for later output
but you can get immediate output with print(dump::Value($object1));
- exercise_dump_display.php illustrates how to tweak the amound of detail
you get in a dump. This helps you find that annoying needle in a haystack by filtering out
Calling dump::Help() displays the reference.
See it now
- A common method of working is to view the live program on one tab and
the output on another (eg. dump::Output('dumped.htm')).
This is fine but remember to reload the tab after each run.
A timestamp is provided for reference.
- protected and private properties are
not dumped. Getting dump to do this would involve a lot of work so
you'll have to use a temporary work around.