Print a back trace from stack for debug in PHP

Description

The following code shows how to print a back trace from stack for debug.

Example


<?php//  w  w  w  . j av a  2  s. co m
    function one($str1, $str2){
        two("XML", "CSS");
    }
    function two($str1, $str2){
        three("Main", "Function");
    }
    function three($str1, $str2){
        debug_print_backtrace();
    }
    
    one("XML", "HTML");
?>

The code above generates the following result.





















Home »
  PHP Tutorial »
    Development »




Environment
Error
Hash
Include
Locale
Math
Network
Output
Reflection
PHP Regular Expressions