Results of 1 - 1 of about 1 for risky (0.000 sec.)
- throw | PHP 8.3 9414
- throw (PHP 5, PHP 7, PHP 8) throw キーワードは式であり、式を書ける場所ならどこでも使えます。 引数として Throwable オブジェクトを受け取ります。 警告 PHP 8.0.0 より前のバージョンでは、 throw キーワードは式ではなく文でした。 Throwable ではない
... 理を分岐させるのに使えます。 例4 throw を式として使う PHP 8.0.0 以降でのみ許されます。 <?php function test () { do_something_risky () or throw new Exception ( 'It did not work' ); } function do_something_risky () { return false ; // 失敗をシミュレートす ...
-
https://man.mtool.work/php/8.3/control-structures.throw.html
PREV
1
NEXT