PHP 异常 构造函数
定义和用法
The Exception()
constructor is used to create an Exception object and set some of its properties。
语法
new Exception(message, code, previous)
参数值
参数 | 描述 |
---|---|
message | Optional. A string describing why the exception was thrown |
代码 | Optional. An integer that can be used used to easily distinguish this exception from others of the same type |
previous | Optional. If this exception was thrown in a catch block of another exception, it is recommended to pass that exception into this parameter |
相关页面
在我们的 PHP Exceptions 章节 中阅读更多关于 Exceptions 的信息。
❮ PHP Exception 参考