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 參考