PHP錯誤報告級別

2022-01-10 17:38:12 字數 925 閱讀 3057

error_reporting = e_all & ~e_notice

; 錯誤報告級別是位字段的疊加,推薦使用

e_all | e_strict

; 1 e_error

致命的執行時錯誤

; 2 e_warning

執行時警告

(非致命性錯誤

); 4 e_parse

編譯時解析錯誤

; 8 e_notice

執行時提醒

(經常是

bug,也可能是有意的

); 16 e_core_error php

啟動時初始化過程中的致命錯誤

; 32 e_core_warning php

啟動時初始化過程中的警告

(非致命性錯

); 64 e_compile_error

編譯時致命性錯

; 128 e_compile_warning

編譯時警告

(非致命性錯

); 256 e_user_error

使用者自定義的致命錯誤

; 512 e_user_warning

使用者自定義的警告

(非致命性錯誤

); 1024 e_user_notice

使用者自定義的提醒

(經常是

bug,也可能是有意的

); 2048 e_strict

編碼標準化警告

(建議如何修改以向前相容

); 4096 e_recoverable_error

接近致命的執行時錯誤,若未**獲則視同

e_error

; 6143 e_all

除e_strict

外的所有錯誤

(php6

中為8191,

即包含所有

)

PHP錯誤報告

級別常量 錯誤值錯誤報告描述 e error 致命的執行時錯誤 阻止指令碼執行 e warning 執行時警告 非致命性錯誤 e parse 從語法中解析錯誤 e notice 執行時注意訊息 可能是或可能不是乙個問題 e core error php啟動時初始化過程中的致命錯誤 e core wa...

PHP 設定錯誤報告

總結 php能夠在執行時動態設定是否顯示錯誤 顯示的錯誤級別。例子 不輸出錯誤報告 error reporting 0 輸出給定級別的錯誤 error reporting e error e warning e parse e notice 輸出除了e notice的他所有錯誤 error repo...

PHP的錯誤報告error reporting

設定錯誤訊息回報的等級。語法 int error reporting int level 傳回值 整數 函式種類 php系統功能 內容說明 本函式用來設定錯誤訊息回報的等級,引數 level 是乙個整數的位元遮罩 bitmask 見下表。value constant 1e error 2e warn...