预定义异常 - PHP手册笔记
生活随笔
收集整理的這篇文章主要介紹了
预定义异常 - PHP手册笔记
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
原文:預(yù)定義異常 - PHP手冊筆記
Exception是所有異常的基類,類摘要如下:
<?php class Exception {protected string $message; // 異常消息內(nèi)容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) }(全文完)
總結(jié)
以上是生活随笔為你收集整理的预定义异常 - PHP手册笔记的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 异常信息详解
- 下一篇: PHP学习之[第11讲]新浪微博开放平台