Introduction Of course, if you already read the previous tutorial of the series, then you're already familiar with using a few simple, yet useful, functions provided by the Xdebug extension, such the popular “var_dump()” function. As you’ll possibly recall, the extension offers an enhanced version of this function that lets you get detailed information about one or more PHP variables. What’s more, when used with an object, the “var_dump()” function permits you to retrieve a complete set of parameters, including the name of the properties of the targeted object, and their types and values. This feature can be pretty useful when debugging object-based PHP programs. Nonetheless, the X-debug extension comes equipped with many other functions that allow you to perform all sorts of debugging tasks. So, provided that you’re interested in learning a bit more, in this fourth article I’ll be explaining how to use the complementary “xdebug_start_code_coverage()” and “xdebug_get_code_coverage()” functions. They can help you keep track of which lines are executed by a specified PHP program. The usage of these functions is very interesting, trust me, so don’t waste more time in preliminaries. Start reading about them now!
blog comments powered by Disqus |