Home arrow PHP arrow Debugging Program Flow with the Xdebug Extension

Debugging Program Flow with the Xdebug Extension

The Xdebug PHP extension combines a set of powerful functions with an easy learning curve. This appealing mixture turns it into the choice of many PHP developers for debugging PHP applications with a great level of detail. If you want to learn how to get the most out of this debugging library without having to spend long hours reading its user manual, then keep reading. In this seven-part series of articles you’ll find an approachable guide to utilizing its most important functions. I will use numerous code samples to instruct you in the use of the Xdebug extension.

TABLE OF CONTENTS:
  1. Debugging Program Flow with the Xdebug Extension
  2. Review: getting information about PHP objects with the var_dump() function
  3. Debugging program flow with the xdebug_start_code_coverage() and xdebug_get_code_coverage() functions
  4. Using the xdebug_start_code_coverage() and xdebug_get_code_coverage() functions with a basic class
By: Alejandro Gervasio
Rating: starstarstarstarstar / 4
February 23, 2009

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

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!



 
 
>>> More PHP Articles          >>> More By Alejandro Gervasio
 

blog comments powered by Disqus
   

PHP ARTICLES

- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...
- PHP: Building Concrete Validators
- Sanitizing Input with PHP
- Executing Shell Commands with PHP
- Handling File Data with PHP
- File Security and Resources with PHP
- ArrayObject PHP Class Examples
- ArrayObject PHP Class: An Introduction
- Getting File System Data with PHP
- PHP Tools for Working with the File and Oper...
- Working with the File and Operating System w...
- PHP Proxy Patterns: Completing a Blog


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 4 - Follow our Sitemap

Dev Shed Tutorial Topics: