PHP error_reporting() လုပ်ဆောင်ချက်
ဥပမာ
မတူညီသော အမှားအယွင်းအဆင့် အစီရင်ခံခြင်းကို သတ်မှတ်ပါ-
<?php
// Turn off error reporting
error_reporting(0);
// Report runtime errors
error_reporting(E_ERROR | E_WARNING | E_PARSE);
// Report all errors
error_reporting(E_ALL);
// Same as error_reporting(E_ALL);
ini_set("error_reporting", E_ALL);
// Report all errors except E_NOTICE
error_reporting(E_ALL & ~E_NOTICE);
?>
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
error_reporting() လုပ်ဆောင်ချက်သည် မည်သည့်အမှားအယွင်းများကို အစီရင်ခံသည်ကို သတ်မှတ်ပေးပါသည်။
PHP တွင် Error အဆင့်များစွာရှိပြီး ဤလုပ်ဆောင်ချက်ကိုအသုံးပြုခြင်းဖြင့် လက်ရှိ script အတွက် ထိုအဆင့်ကို သတ်မှတ်ပေးပါသည်။
အထားအသို
error_reporting(level);
ကန့်သတ်တန်ဖိုးများ
Parameter | Description |
---|---|
level | Optional. Specifies the error-report level for the current script. Error numbers and named constants are accepted. Note: Named constants are recommended to ensure compatibility for future PHP versions |
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | အဆင့် သတ်မှတ်ချက်ကို မပေးပါက ယခင်အမှားအစီရင်ခံမှုအဆင့် သို့မဟုတ် လက်ရှိအမှားအစီရင်ခံမှုအဆင့်ကို ပြန်ပေးသည် ။ |
---|---|
PHP ဗားရှင်း- | 4.0+ |
PHP Changelog- | PHP 5.4- E_STRICT သည် ယခုအခါ E_ALL ၏ အစိတ်အပိုင်းတစ်ခုဖြစ်သည်။ PHP 5.3- အသစ်- E_DEPRECATED နှင့် E_USER_DEPRECATED။ PHP 5.2- အသစ်- E_RECOVERABLE_ERROR။ PHP 5.0- အသစ်- E_STRICT။ |
PHP Error အကိုးအကား