ホームページ  >  記事  >  バックエンド開発  >  事前定義された例外

事前定義された例外

WBOY
WBOYオリジナル
2016-06-23 13:39:02867ブラウズ

Exception はすべての例外の基本クラスです。 クラスの概要は次のとおりです:

<?php class Exception {	protected string $message;  // 异常消息内容	protected int $code;  // 异常代码	protected string $file;  // 抛出异常的文件名	protected int $line;  // 抛出异常在该文件的行号	public __construct([string $message = "" [, int $code = 0 [, Exception $previous = NULL]]])	final public string getMessage(void)	final public Exception getPrevious(void)	final public int getCode(void)	final public string getFile(void)	final public int getLine(void)	final public array getTrace(void)	final public string getTraceAsString(void)	public string __toString(void)	final private void __clone(void)}

ErrorException クラスの概要は次のとおりです:

<?php class ErrorException extends Exception {	protected int $severity;  // 异常级别	public __construct([string $message = "" [, int $code = 0 [, int $severity = 1 [, string $filename = __FILE__ [, int $lineno = __LINE__ [, Exception $previous = NULL]]]]]])	final public int getSeverity(void)}

(全文終了)

声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。