PHP Conference Japan 2024

AssertionError

(PHP 7, PHP 8)

簡介

當透過 assert() 進行的斷言失敗時,會拋出 AssertionError

類別概要

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

使用者貢獻的註解

此頁面尚無使用者提供的註記。
To Top