what is PHP debug_backtrace() Function?

The debug_backtrace() function generates a PHP backtrace.

This function displays data from the code that led up to the debug_backtrace() function.

Returns an array of associative arrays. The possible returned elements are:

Syntax :

debug_backtrace();

<?php

public function invoice_print($data)

{

$storeinfo = $data['storeinfo'];

        $orderinfo = $data['orderinfo'];

        $customerinfo = $data['customerinfo'];

Example of PHP function:

echo "<pre>";

var_dump(debug_backtrace());

exit;

}

?>


Out put :

array(3) {

 [0]=>

 array(7) {

 ["file"]=>

 string(90) "C:\xampp\htdocs\webgrid\computerbaba\application\modules\ordermanage\controllers\Order.php"

 ["line"]=>

 int(3727)

 ["function"]=>

 string(13) "invoice_print"

 ["class"]=>

 string(5) "Order"

 ["object"]=>

 object(Order)#32 (2) {

 ["autoload"]=>

 array(0) {

 }

 ["load"]=>

 object(MY_Loader)#18 (13) {

 ["_ci_ob_level":protected]=>

 int(1)

 ["_ci_view_paths":protected]=>

 &array(1) {

 ["C:\xampp\htdocs\webgrid\computerbaba\application\views\"]=>

 bool(true)

 }

 ["_ci_library_paths":protected]=>

 &array(2) {

 [0]=>

 string(49) "C:\xampp\htdocs\webgrid\computerbaba\application\"

 [1]=>

 string(44) "C:\xampp\htdocs\webgrid\computerbaba\system\"

 }

 ["_ci_model_paths":protected]=>

 &array(2) {

 [0]=>

 string(69) "C:\xampp\htdocs\webgrid\computerbaba\application\modules/ordermanage/"

 [1]=>

 string(49) "C:\xampp\htdocs\webgrid\computerbaba\application\"

 }

 ["_ci_helper_paths":protected]=>

 &array(2) {

 [0]=>

 string(49) "C:\xampp\htdocs\webgrid\computerbaba\application\"

 [1]=>

 string(44) "C:\xampp\htdocs\webgrid\computerbaba\system\"

 }

 ["_ci_cached_vars"]=>

 &array(0) {

 }

 ["_ci_classes":protected]=>

 &array(25) {

 ["benchmark"]=>

 string(9) "Benchmark"

 ["hooks"]=>

 string(5) "Hooks"

 ["config"]=>

 string(6) "Config"

 ["log"]=>

 string(3) "Log"

 ["utf8"]=>

 string(4) "Utf8"

 ["uri"]=>

 string(3) "URI"

 ["router"]=>

 string(6) "Router"

 ["output"]=>

 string(6) "Output"

 ["security"]=>

 string(8) "Security"

 ["input"]=>

}

}


Description :

Name Type Description

function string The current function name

line integer The current line number

file string The current file name

class string The current class name

object object The current object.

Sign In or Register to comment.