« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 10 of about 153 for throw (0.001 sec.)
throw | PHP 8.3 11300
throw (PHP 5, PHP 7, PHP 8) throw キーワードは式であり、式を書ける場所ならどこでも使えます。 引数として Throwable オブジェクトを受け取ります。 警告 PHP 8.0.0 より前のバージョンでは、 throw キーワードは式ではなく文でした。 Throwable ではない ... オブジェクトを throw しようとすると、 Error がスローされます。 ユーザー定義クラスは Throwable を直接実装できないため、 スローするオブジェクトは ... Error クラスか Exception クラス、 またはそれらのサブクラスのインスタンスでなければなりません。 例1 Throwable ではないオブジェクトをスローする <?php throw new class {}; 上の例の出力は、 たとえば以下のようになります。 PHP Fatal e ... rror: Uncaught Error: Cannot throw objects that do not implement Throwable in Command line code:1 Stack trace: #0 {main} throw を使うと通常の処理の流れは中断 ...
https://man.mtool.work/php/8.3/control-structures.throw.html
Componere\cast — Casting | PHP 8.3 9939
Componere\cast (Componere 2 >= 2.1.2) Componere\cast — Casting 説明 function Componere\cast ( string $type , object $object ): object パラメータ type A user defined type object An object with a user defined type compatible with Type 戻り値 ... An object of type Type , cast from object エラー / 例外 警告 Shall throw InvalidArgumentException if the type of object is or is derived from an internal class 警告 Shall throw InvalidArgumentExc ... eption if Type is an interface 警告 Shall throw InvalidArgumentException if Type is a trait 警告 Shall throw InvalidArgumentException if Type is an abstract 警告 Shall th ...
https://man.mtool.work/php/8.3/componere.cast.html
Componere\cast_by_ref — Casting | PHP 8.3 9788
Componere\cast_by_ref (Componere 2 >= 2.1.2) Componere\cast_by_ref — Casting 説明 function Componere\cast_by_ref ( string $type , object $object ): object パラメータ type A user defined type object An object with a user defined type compati ... 戻り値 An object of type Type , cast from object , where members are references to object members エラー / 例外 警告 Shall throw InvalidArgumentException if the type of object is or is derived from an internal class 警告 Shall throw InvalidArgumentExc ... eption if Type is an interface 警告 Shall throw InvalidArgumentException if Type is a trait 警告 Shall throw InvalidArgumentException if Type is an abstract 警告 Shall th ...
https://man.mtool.work/php/8.3/componere.cast_by_ref.html
Componere\Definition::__construct — Definition Construction | PHP 8.3 9707
Componere\Definition::__construct (Componere 2 >= 2.1.0) Componere\Definition::__construct — Definition Construction 説明 public function Componere\Definition::__construct ( string $name ) public function Componere\Definition::__construct ( ... class name parent A case insensitive class name interfaces An array of case insensitive class names Exceptions 警告 Shall throw InvalidArgumentException if an attempt is made to replace an internal class 警告 Shall throw InvalidArgumentException if a ... n attempt is made to replace an interface 警告 Shall throw InvalidArgumentException if an attempt is made to replace a trait 警告 Shall throw RuntimeException if a class in interfac ... es cannot be found 警告 Shall throw RuntimeException if a class in interfaces is not an interface 他のマニュアルの関連ページ Linux JM standards(7) ...
https://man.mtool.work/php/8.3/componere-definition.construct.html
Componere\Definition::addConstant — Add Constant | PHP 8.3 9021
Componere\Definition::addConstant (Componere 2 >= 2.1.0) Componere\Definition::addConstant — Add Constant 説明 public function Componere\Definition::addConstant ( string $name , Componere\Value $value ): Definition Shall declare a class con ... tant value The Value for the constant, must not be undefined or static 戻り値 The current Definition Exceptions 警告 Shall throw RuntimeException if Definition was registered 警告 Shall throw RuntimeException if name is already declared as a constant ... 警告 Shall throw RuntimeException if value is static 警告 Shall throw RuntimeException if value is undefined 他のマニュアルの関連ページ Duc ...
https://man.mtool.work/php/8.3/componere-definition.addconstant.html
parallel\Future::value — Resolution | PHP 8.3 9021
parallel\Future::value (0.8.0) parallel\Future::value — Resolution 説明 public function parallel\Future::value (): mixed Shall return (and if necessary wait for) return from task Exceptions 警告 Shall throw parallel\Future\Error if waiting ... failed (internal error). 警告 Shall throw parallel\Future\Error\Killed if parallel\Runtime executing task was killed. 警告 Shall throw parallel\Future\Error\Cancell ... ed if task was cancelled. 警告 Shall throw parallel\Future\Error\Foreign if task raised an unrecognized uncaught exception. 警告 Shall rethrow Throwable uncaught in ...
https://man.mtool.work/php/8.3/parallel-future.value.html
Generator::throw — 例外をジェネレータにスローする | PHP 8.3 8800
Generator::throw (PHP 5 >= 5.5.0, PHP 7, PHP 8) Generator::throw — 例外をジェネレータにスローする 説明 public function Generator::throw ( Throwable $exception ): mixed 例外をジェネレータにスローして、ジェネレータを続行します。 この振る舞いは ... 、現在の yield 式の部分を throw $exception 文に置き換えたのと同じになります。 このメソッドの起動時に既にジェネレータが閉じられている場合は、呼び出し側のコ ... xception $e ) { echo "Exception: { $e -> getMessage ()} \n" ; } echo "Bar\n" ; } $gen = gen (); $gen -> rewind (); $gen -> throw (new Exception ( 'Test' )); ?> 上の例の出力は以下となります。 Foo Exception: Test Bar 他のマニュアルの関連ページ Python 2. ...
https://man.mtool.work/php/8.3/generator.throw.html
parallel\Runtime::run — Execution | PHP 8.3 8800
parallel\Runtime::run (0.8.0) parallel\Runtime::run — Execution 説明 public function parallel\Runtime::run ( Closure $task ): ? Future Shall schedule task for execution in parallel. public function parallel\Runtime::run ( Closure $task , ar ... y, and so may not be shared. 戻り値 警告 The return parallel\Future must not be ignored when the task contains a return or throw statement. Exceptions 警告 Shall throw parallel\Runtime\Error\Closed if parallel\Runtime was closed. 警告 Shall throw para ... llel\Runtime\Error\IllegalFunction if task is a closure created from an internal function. 警告 Shall throw parallel\Runtime\Error\IllegalInstruction if task contains illegal instructions. 警告 Shall throw parallel\Runtime\Error\I ... llegalParameter if task accepts or argv contains illegal variables. 警告 Shall throw parallel\Runtime\Error\IllegalReturn if task returns illegally. 他のマニュアルの関連ページ Linux JM accept(2) Linux JM nam ...
https://man.mtool.work/php/8.3/parallel-runtime.run.html
try...catch | PHP 8.3 8649
try...catch try (PHP 5, PHP 7, PHP 8) try ブロックは、処理が必要な Throwable エラーを throw する可能性があるコードを囲むもので、 対応する catch ブロックあるいは finally ブロックが 必ず ひとつ以上必要です。 try ブロック内で Throwable エラーが ... れに渡され、 なければ、スクリプトは致命的なエラーで終了します。 catch (PHP 5, PHP 7, PHP 8) catch ブロックには、スローされた Throwable エラーにどのように対処するかを記述します。 このブロックには、処理できる Throwable のサブクラス (多くの場合は Exception ... 配下のクラス) をひとつ以上指定します。 オプションで、例外を代入する変数も指定できます。 スローされた Throwable オブジェクトのクラスにマッチする 最初の catch ブロックが、そのエラーを処理します。 通常の実行はその catch ブロックの後 ... ジェクトはプログラミング上のエラーを示すものなので、キャッチすることは 推奨されません 。 例1 例外をキャッチする <?php try { throw new Exception ( 'Error' ); } catch ( Exception $e ) { echo 'Caught exception: ' , $e -> getMessage (), "\n" ; } // 実行は継 ...
https://man.mtool.work/php/8.3/control-structures.try-catch.html
Fiber::suspend — 現在実行中のファイバーを停止する | PHP 8.3 8649
Fiber::suspend (PHP 8 >= 8.1.0) Fiber::suspend — 現在実行中のファイバーを停止する 説明 public static function Fiber::suspend ( mixed $value = null ): mixed 現在実行中のファイバーを停止します。 このメソッドに渡した値が、 Fiber::start() , Fib ... er::resume() , Fiber::throw() から返されます。 但し、 Fiber::throw() は 実行の制御が現在のファイバーに移った場合に限ります。 ファイバーの実行が再開され ... ると、 このメソッドは Fiber::resume() に渡された値を返します。 ファイバーの実行が Fiber::throw() を使って再開された場合、 そのメソッドに渡された例外が、 このメソッドの呼び出しからスローされます。 このメソッドがファイバ ... ーの外部からコールされた場合、 FiberError がスローされます。 パラメータ value Fiber::start() , Fiber::resume() , Fiber::throw() を呼び出した際に返される値。 但し、 Fiber::throw() は 実行の制御が現在のファイバーに移った場合に限ります。 戻り値 Fiber: ...
https://man.mtool.work/php/8.3/fiber.suspend.html
PREV 1 2 3 4 5 6 7 8 9 10 NEXT