ErrorException::__construct
(PHP 5 >= 5.1.0, PHP 7, PHP 8)
ErrorException::__construct — 構造一個異常(Exception)
說明
public ErrorException::__construct(
string
int
int
?string
?int
?Throwable
)
string
$message = "",int
$code = 0,int
$severity = E_ERROR,?string
$filename = null,?int
$line = null,?Throwable
$previous = null)
構造一個異常(Exception)。
參數
-
message -
拋出的異常訊息內容。
-
code -
異常程式碼。
-
severity -
異常的嚴重級別。
注意:
severity 可以是任意 int 值,即錯誤常量裡面的值。
-
filename -
拋出異常所在的檔名。
-
line -
拋出異常所在的行號。
-
previous -
異常鏈中的前一個異常。
更新日誌
| 版本 | 說明 |
|---|---|
| 8.0.0 |
現在 filename 和 line 可以為空。
之前,它們的預設值分別是 __FILE__ 和
__LINE__ 。
|