PHP debug_print_backtrace() º¯Êý
Example
´òÓ¡Ò»Ìõ PHP »ØËÝ£º
<?php
function a($txt) {
b("Glenn");
}
function b($txt) {
c("Cleveland");
}
function c($txt) {
debug_print_backtrace();
}
a("Peter");
?>
ÒÔÉÏ´úÂëµÄÊä³öÀàËÆÕâÑù£º
#0 c(Cleveland) called at [C:\webfolder\test.php:6] #1 b(Glenn) called at [C:\webfolder\test.php:3] #2 a(Peter) called at [C:\webfolder\test.php:11]
¶¨ÒåºÍÓ÷¨
debug_print_backtrace() º¯Êý´òÓ¡ PHP »ØËÝ£¨backtrace£©¡£
debug_print_backtrace() ´òÓ¡ÁËÒ»Ìõ PHP »ØËÝ¡£Ëü´òÓ¡Á˺¯Êýµ÷Óᢱ» included/required µÄÎļþºÍ eval() µÄ´úÂë¡£
Óï·¨
debug_print_backtrace(options,limit);
| ²ÎÊý | ÃèÊö |
|---|---|
| options |
¿ÉÑ¡¡£¹æ¶¨ÒÔϲÎÊýµÄλÑÚÂ룺
|
| limit | ¿ÉÑ¡¡£ÓÃÓÚÏÞÖÆ·µ»Ø¶ÑÕ»Ö¡µÄÊýÁ¿¡£Ä¬ÈÏΪ (limit=0) £¬·µ»ØËùÓеĶÑÕ»Ö¡¡£ |
¼¼Êõϸ½Ú
| ·µ»ØÖµ£º | None |
|---|---|
| PHP °æ±¾£º | 5.0+ |
| PHP ¸üÐÂÈÕÖ¾£º |
PHP 5.4£ºÌí¼ÓÁË¿ÉÑ¡µÄ²ÎÊý limit¡£ PHP 5.3.6: Ìí¼ÓÁË¿ÉÑ¡µÄ²ÎÊý options¡£ |