·您现在的位置: 云翼网络 >> 文章中心 >> 网站建设 >> 网站建设开发 >> php网站开发 >> 预定义异常

预定义异常

作者:佚名      php网站开发编辑:admin      更新时间:2022-07-23
预定义异常 - php手册笔记

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)}

(全文完)