码迷,mamicode.com
首页 > Web开发 > 详细

预定义异常 - PHP手册笔记

时间:2015-06-19 15:08:16      阅读:175      评论:0      收藏:0      [点我收藏+]

标签:

原文:预定义异常 - 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)
}

(全文完)

预定义异常 - PHP手册笔记

标签:

原文地址:http://www.cnblogs.com/lonelyxmas/p/4588495.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!