ErrorException

(PHP 5 >= 5.1.0)

简介

错误异常。 

类摘要

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)

/* 继承的方法 */

final public string Exception::getMessage( void)

final public Exception Exception::getPrevious( void)

final public int Exception::getCode( void)

final public string Exception::getFile( void)

final public int Exception::getLine( void)

final public array Exception::getTrace( void)

final public string Exception::getTraceAsString( void)

public string Exception::__toString( void)

final private void Exception::__clone( void)

}

属性

severity 

异常级别

范例

Example #1 使用 set_error_handler()函数将错误信息托管至ErrorException

<?php

function exception_error_handler($errno, $errstr, $errfile, $errline ) {

    throw new ErrorException($errstr, 0, $errno, $errfile, $errline);

}

set_error_handler("exception_error_handler");

/* Trigger exception */

strpos();

?>  

以上例程的输出类似于:

Fatal error: Uncaught exception 'ErrorException' with message 'Wrong parameter count for strpos()' in /home/bjori/tmp/ex.php:8

Stack trace:

#0 [internal function]: exception_error_handler(2, 'Wrong parameter...', '/home/bjori/php...', 8, Array)

#1 /home/bjori/php/cleandocs/test.php(8): strpos()

#2 {main}

  thrown in /home/bjori/tmp/ex.php on line 8

Table of Contents

◾ErrorException::__construct — 异常构造函数

◾ErrorException::getSeverity — 获取异常的严重程度

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论

热门产品

php编程基础教程.pptx|php编程培训,php,编程,基础,教程,pptx
php编程基础教程.pptx

历史上的今天:04月28日

referrer策略和meta标签的问题

referrer策略和meta标签的问题请求后端接口时,banner图片的请求出现403错误:GEThttp://xxxxxxxxxxxx403(Forbidden)。在网上搜寻一番,解决方法如下:在index.html中的head中添加&lt;meta name=&quot;referrer&quot; content=&quot;no-referrer&quot; /&gt;。在此之前,关于r

热门专题

自考本科|自考本科有用吗,自考文凭,自考本科文凭,自考文凭有用吗,自考本科文凭有用吗,自考文凭承认吗
自考本科
弥勒综合高中|弥勒综合高中
弥勒综合高中
金诺幼儿园(春城路金诺幼儿园)|昆明官渡区幼儿园,幼儿园报名,官渡区幼儿园,春城路幼儿园,幼儿园招生,学前班,昆明幼儿园,金诺幼儿园,环城南路幼儿园,石井路幼儿园
金诺幼儿园(春城路金诺幼儿园)
昆明网站建设|昆明网站建设,昆明网站开发,昆明网站建设公司,昆明网站建设价格,昆明网站设计,昆明网站制作,网页设计,高端网站建设,高端网站设计
昆明网站建设
中源管业|中源管业,中源管业公司,中源管业有限公司,中源管业电话,中源管业地址,中源管业电力管,中源管业mpp电力管,中源管业cpvc电力管,中源管业pe穿线管
中源管业
小程序开发|微信小程序,小程序开发,小程序,小程序制作,微信小程序开发,小程序公司,小程序开发公司,分销,三级分销系统,分销系统
小程序开发
外贸网站建设|外贸网站建设,英文网站制作,英文网站设计,美国主机空间,外贸建站平台,多语言网站制作
外贸网站建设
安徽中源管业|安徽中源管业,安徽中源管业mpp电力管,安徽中源管业cpvc电力管,安徽中源管业pe穿线管,安徽中源管业电力管,安徽中源管业排水管,安徽中源管业通信管,安徽中源管业管材
安徽中源管业

微信小程序

微信扫一扫体验

立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部