Home arrow PHP arrow Tracking a Stack of Function Calls with the Xdebug Extension

Tracking a Stack of Function Calls with the Xdebug Extension

If you’re a PHP programmer looking for a comprehensive guide to using the most relevant functions that come with the X-debug extension, then this set of articles might be what you need. Welcome to the last part of a series focusing on debugging in PHP with the Xdebug extension. In seven approachable parts, this series gets you started utilizing this library's numerous features by way of a hands-on approach.

TABLE OF CONTENTS:
  1. Tracking a Stack of Function Calls with the Xdebug Extension
  2. Review: the xdebug_time_index() function
  3. Retrieving information with the xdebug_get_function_stack() function
  4. Displaying the contents of the stack of function calls
By: Alejandro Gervasio
Rating: starstarstarstarstar / 2
March 16, 2009

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

Introduction

Now that you’ve been introduced to the main subject of this series, it’s time to recapitulate the topics that were treated in the last installment, so you can see more clearly how to link them with the ones that I plan to discuss in this final part.

So, in simple terms, in the aforementioned article I explained how to take advantage of the functionality provided by the “xdebug_time_index()” function to build a couple of timing scripts. I started by using a procedural approach, and then took advantage of the object-oriented paradigm.

In the first case, this function in question was utilized simply for measuring the execution time of a primitive “for” loop, which was very simple to grasp. In the second example, things were more complicated, since it was used as the workhorse of a timer class. Anyway, both examples should be considered only as an introduction to using this handy function in more complex situations.

In addition, the Xdebug extension comes bundled with a few other functions, which, despite their potential functionality, simply can’t be covered completely in a series like this. Despite this inconvenience, in this final part of the series, I’m going to show you how to work with a function of the library called “xdebug_get_function_stack().” This function can be used to keep track of the stack of function calls generated by a PHP script, in this manner completing this starting guide on this helpful extension.

Does this sound good enough for you? Then start reading!



 
 
>>> 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 5 - Follow our Sitemap

Dev Shed Tutorial Topics: