Home > php教程 > PHP开发 > PHP debug_backtrace() stack debugging

PHP debug_backtrace() stack debugging

黄舟
Release: 2016-12-28 13:42:17
Original
1898 people have browsed it

Example

<?php 
function one($str1, $str2) 
{ 
two("Glenn", "Quagmire"); 
} 
function
two($str1, $str2) 
{ 
three("Cleveland", "Brown"); 
} 
function three($str1,$str2) 
{ 
print_r(debug_backtrace()); 
} 
one("Peter", "Griffin"); 
?>
Copy after login

Output:

Array ( [0] => Array ( [file] => C:\webfolder\test.php [line] => 7
[function] => three [args] => Array ( [0] => Cleveland [1] => Brown ) )
[1] => Array ( [file] => C:\webfolder\test.php [line] => 3 [function] =>
two [args] => Array ( [0] => Glenn [1] => Quagmire ) ) [2] => Array (
[file] => C:\webfolder\test.php [line] => 14 [function] => one [args] =>
Array ( [0] => Peter [1] => Griffin ) ) )
Copy after login

The above is the content of PHP debug_backtrace() stack debugging. For more related content, please pay attention to the PHP Chinese website (www.php .cn)!


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template