« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 1 of about 1 for customFunction (0.002 sec.)
Throwable エラー | PHP 8.3 9414
Throwable エラー Throwable エラーとは、実行中に発生し、 通常の命令の流れを中断するイベントです。 Throwable エラーが throw されると、 catch ブロックでキャッチされるか、グローバルスコープに達するまで、 コールスタックが巻き戻されます。 巻き戻し ... public function __toString () { return __CLASS__ . ": [ { $this -> code } ]: { $this -> message } \n" ; } public function customFunction () { echo "A custom function for this type of exception\n" ; } } try { throw new CustomException ( "Something happened" , ... 5 ); } catch ( CustomException $e ) { echo "Caught custom exception\n" , $e ; $e -> customFunction (); } 上の例の出力は以下となります。 Caught custom exception CustomException: [5]: Something happened A custom function fo ...
https://man.mtool.work/php/8.3/language.error-handling.throwable.html
PREV 1 NEXT