Welcome to the sixth installment of a series that covers debugging in PHP with the Xdebug extension. Comprised of seven approachable tutorials, this series gets you started using the set of functions provided by this helpful library, so you can begin debugging your own PHP applications with an excellent level of control.
In case you haven’t heard about it yet, the Xdebug extension is a full-featured library that allows you to perform all sorts of debugging tasks in PHP. These range from checking the values assigned to variables and determining which program lines are executed by the PHP engine, to performing more complex operations, such as benchmarking entire applications and verifying in which order functions are called by a script.
Of course, it’s nearly impossible to learn how to achieve all of these tasks in only one single step, so if you’re interested in mastering the most relevant methods that come bundled with the Xdebug PHP extension, then you might want to have a close look at this group of educational articles.
Now that you’re aware of the topics that are covered in this series of articles, it’s time to recall what we discussed in the previous part. In that particular chapter, I used a couple of examples to help explain how to use the “xdebug_start_code_coverage()” and “xdebug_get_code_coverage()” functions to keep track of the sequence of lines executed by a sample PHP script.
These functions permit you to verify, with a decent level of accuracy, the order in what the different blocks that compose a certain PHP application are called by the interpreter. Logically, performing this controlling process helps to debug errors that are commonly raised when working with conditional statements and recursive functions, which under normal conditions are pretty hard to grab.
You'll be pleased to hear that the Xdebug extension comes equipped with additional functions that allow us to perform other debugging tasks, such as benchmarking PHP applications and checking in what order certain functions were called by the PHP engine.
Therefore, in this sixth chapter of the series I’ll be discussing in depth how to take advantage of the benchmarking abilities offered by the Xdebug library, which rely heavily on its “xdebug_time_index()” function.
Are you ready to learn how to use this brand new debugging function? Then click on the link that appears below and start reading now!