debug_print_backtrace in PHP

Syntax of debug_print_backtrace

void debug_print_backtrace()

Prints the current debug backtrace (see debug_backtrace) to the client

Example of debug_print_backtrace

<?php
// include.php file

function a() {
    b();
}

function b() {
    c();
}

function c(){
    debug_print_backtrace();
}

a();

?>
<?php
// test.php file
// this is the file you should run

include 'include.php';
?>
#0  c() called at [/tmp/include.php:10]
#1  b() called at [/tmp/include.php:6]
#2  a() called at [/tmp/include.php:17]
#3  include(/tmp/include.php) called at [/tmp/test.php:3]

Leave a Comment