PHP SPL Exceptions Class
2016-11-24 23:22:40 0 举报
PHP SPL(Standard PHP Library)中的Exceptions类是一个用于处理异常的基类。它提供了一些基本的异常处理方法,如抛出异常、捕获异常和获取异常信息等。通过继承Exceptions类,可以创建自定义的异常类,以便在程序中抛出特定类型的异常。这些异常可以在try-catch语句中使用,以捕获并处理可能发生的错误或异常情况。使用Exceptions类可以帮助开发人员更好地管理和维护代码,提高程序的健壮性和可靠性。
作者其他创作
大纲/内容
UnderflowException
InvalidArgumentException
Exception Methods:public __construct ([ string $message = \"\
Exception
DomainException
OutOfRangeException
RuntimeException
Exception that represents error in the program logic.
UnexpectedValueException
OverflowException
Exception is the base class for all Exceptions
RangeException
BadMethodCallException
OutOfBoundsException
BadFunctionCallException
# message:string# code:int# file:string# line:int
+ __construct (params):returnType+ getMessage():string+ getPrevious():Exception+ getCode():mixed+ getFile():string+ getLine():int+ getTrace():array+ getTraceAsString():string+ __toString():string- __clone()
LogicException
Exception thrown if an error which can only be found on runtime occurs.
LengthException
0 条评论
下一页