Now that we’ve successfully navigated through the application, let’s take a look at some more useful features of the debugger, and how we can use them to solve common problems that we face.
The Variables view is not limited to outputting simple key/value pairs. It also gives us information on more complex objects.
Arrays can be complicated beasts. Throw in variables as indexes, looping, and multi-dimensional arrays and they become even more complicated. Even the standard echoing of variables is not easy because often, it’s hard to figure out what you want to display. Fortunately, the Variables view handles them with ease.
Consider this code:
<?php $myArray = array(); $myArray[0] = "Zero"; $myArray[1] = "One"; ?>
We declare an array and give it two elements. The Variables view will nest the individual elements underneath the array like this:
Multi-dimensional arrays are basically single...