PHP debug_backtrace() လုပ်ဆောင်ချက်
ဥပမာ
PHP backtrace ကို ဖန်တီးပါ-
<?php
function a($txt) {
b("Glenn");
}
function b($txt) {
c("Cleveland");
}
function c($txt) {
var_dump(debug_backtrace());
}
a("Peter");
?>
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
debug_backtrace() လုပ်ဆောင်ချက်သည် PHP backtrace ကိုထုတ်ပေးသည်။
ဤလုပ်ဆောင်ချက်သည် debug_backtrace() လုပ်ဆောင်ချက်သို့ ဦးတည်သည့် ကုဒ်မှ အချက်အလက်များကို ပြသသည်။
associative array ၏ array ကို ပြန်ပေးသည်။ ပြန်ရနိုင်သော အစိတ်အပိုင်းများမှာ-
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 |
type | string | The current call type. Possible calls:
|
args | array | If inside a function, it lists the functions arguments. If inside an included file, it lists the included file names |
အထားအသို
debug_backtrace(options, limit);
ကန့်သတ်တန်ဖိုးများ
Parameter | Description |
---|---|
options | Optional. Specifies a bitmask for the following options: DEBUG_BACKTRACE_PROVIDE_OBJECT (Whether or not to populate the "object" index DEBUG_BACKTRACE_IGNORE_ARGS (Whether or not to omit the "args" index, and all the function/method arguments, to save memory) |
limit | Optional. Limits the number of stack frames printed. By default (limit=0) it prints all stack frames |
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | Associative array များ |
---|---|
PHP ဗားရှင်း- | 4.3+ |
PHP Changelog- | PHP 5.4- ရွေးချယ်နိုင်သော ကန့်သတ် ဘောင်ကို PHP 5.3.6 တွင် ထည့်သွင်းခဲ့သည် - ပါရာမီတာကို provide_object အား ရွေးချယ်စရာများ အဖြစ် ပြောင်းလဲခဲ့ပြီး နောက်ထပ်ရွေးချယ်စရာ DEBUG_BACKTRACE_IGNORE_ARGS ကို PHP 5.2.5 တွင် ထည့်သွင်းထားသည်- ရွေးချယ်နိုင်သော ကန့်သတ်ဘောင်အား provide_object ကို ထည့်သွင်းခဲ့သည် PHP 5.1.1- လက်ရှိအရာဝတ္တုကို ဖြစ်နိုင်သမျှ ထည့်ထားသည်။ return element |
PHP Error ကိုးကား