So far, we have been focusing on the error messages PHP generates. Initially we looked at the output of the parser as it validates the source code syntax before trying to execute it. After that, we learned about logging in PHP—how it works, how to customize, and how to leverage to our benefit. Next, let's try to add to the information to give us more clues if something goes wrong. In particular, there are several built-in functions and constants that can be used for this purpose. Let's start by discussing these functions and constants and then try to integrate them into a class that will give us additional information and conveniences when debugging code.
There are several core PHP functions that are helpful in outputting and formatting debug information. I would expect that you are familiar with at least some of the functions listed below, but familiarizing yourself with some of the others will help you to choose the ones that most closely match your...