« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 1 of about 1 for SpecificException (0.001 sec.)
try...catch | PHP 8.3 9414
try...catch try (PHP 5, PHP 7, PHP 8) try ブロックは、処理が必要な Throwable エラーを throw する可能性があるコードを囲むもので、 対応する catch ブロックあるいは finally ブロックが 必ず ひとつ以上必要です。 try ブロック内で Throwable エラーが ... ブジェクトへアクセスすることはできません。 例6 キャッチするときに変数を省略する PHP 8.0.0 以降でのみ許されます。 <?php class SpecificException extends Exception {} function test () { throw new SpecificException ( 'Oopsie' ); } try { test (); } catch ( SpecificExcep ... tion ) { print "A SpecificException was thrown, but we don't care about the details." ; } 上の例の出力は以下となります。 A SpecificException was thrown, but w ...
https://man.mtool.work/php/8.3/control-structures.try-catch.html
PREV 1 NEXT