2024 年 PHP 日本會議

未處理的匹配錯誤

(PHP 8)

簡介

當傳遞給 match 運算式的值未被任何 match 運算式的分支處理時,會拋出 未處理的匹配錯誤

類別概要

class UnhandledMatchError extends Error {
/* 繼承的屬性 */
protected string $message = "";
private string $string = "";
protected int $code;
保護的 字串 $file = "";
保護的 整數 $line;
私有的 陣列 $trace = [];
私有的 ?Throwable $previous = null;
/* 繼承的方法 */
公開的 Error::__construct(字串 $message = "", 整數 $code = 0, ?Throwable $previous = null)
最終 公開的 Error::getMessage(): 字串
最終 公開的 Error::getPrevious(): ?Throwable
最終 公開的 Error::getCode(): 整數
最終 公開的 Error::getFile(): 字串
最終 公開的 Error::getLine(): 整數
最終 公開的 Error::getTrace(): 陣列
最終 公開的 Error::getTraceAsString(): 字串
私有的 Error::__clone():
}
新增註釋

使用者貢獻的註釋

此頁面沒有使用者貢獻的註釋。
To Top