PHP
  Home arrow PHP arrow Page 4 - Using the Xdebug Extension`s xdebug_call_function() Function
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
PHP

Using the Xdebug Extension`s xdebug_call_function() Function
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 2
    2009-02-09


    Table of Contents:
  • Using the Xdebug Extension`s xdebug_call_function() Function
  • Review: the xdebug_call_file() and xdebug_call_line() functions
  • Using the xdebug_call_function() function
  • Testing the xdebug_call_function()

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Using the Xdebug Extension`s xdebug_call_function() Function - Testing the xdebug_call_function()
    ( Page 4 of 4 )

    To demonstrate how useful the "xdebug_call_function()" can be for debugging purposes, I'm going to build a simple script which will make use of the "User" class that you saw in the previous section. In this case, the script simply will be tasked with creating a new instance of this class, and then with calling its "getFunction()" method.

    The result of this operation can be seen in the code sample below:


    try{

    $user=new User('John','Doe','john@domain.com');

    echo $user->getFunction();

     

    /* displays the following

    Called from function {main}

    */

    }

    catch(Exception $e){

    echo $e->getMessage();

    exit();

    }


    Well, if you were expecting an output of one hundred lines, then probably you'll be a bit disappointed with the result produced by the above example. However, it's pretty illustrative, since it shows in a nutshell how the "xdebug_call_function()" really works. In this particular example, the function has been wrapped within a class method, so it returns the name of the function from which it was actually called, that is the C "main" function.

    With this basic example, it's clear to see how deeply the xdebug_call_function()" can dig when it comes to determining from which function a method or statement has been invoked. Simple and effective, right?

    And finally, as usual with many of my articles on PHP development, feel free to tweak all of the code samples shown in this tutorial to give you some practice in using the "xdebug_call_function()" function provided by the Xdebug extension. You'll have a good time doing this, guaranteed!

    Final thoughts

    In this second installment of the series, I walked you through using the "xdebug_call_function()" function, bundled with the X-debug extension, to keep track of the different functions calls triggered by a PHP script.

    In the next part, I will explain how to use the enhanced version of the "var_dump()" PHP built-in function to retrieve detailed information about a specified variable. Now that you know the subject of the upcoming article, you won't want to miss it!



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

       

    PHP ARTICLES

    - Adding Ordering and Grouping Clauses to the ...
    - Implementing Factory Methods in PHP 5
    - Merging a File Split for FTP Upload using PHP
    - Getting Data from Yahoo Site Explorer Inboun...
    - Method Chaining: Adding More Selecting Metho...
    - How to Split a File During an FTP Upload Usi...
    - Expanding a Custom CodeIgniter Library with ...
    - Using the Yahoo Site Explorer Inbound Links ...
    - Building a CodeIgniter Custom Library with M...
    - Building an E-mini Trading System Using PHP ...
    - Completing the MySQL Class with Method Chain...
    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek