« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 10 of about 45 for generator (0.071 sec.)
Generator::rewind — 最初の yield までジェネレータを実行する | PHP 8.3 12923
Generator::rewind (PHP 5 >= 5.5.0, PHP 7, PHP 8) Generator::rewind — 最初の yield までジェネレータを実行する 説明 public function Generator::rewind (): void 最初の yield までジェネレータを実行します。 ジェネレータが既に 最初の yield に到達し ... 行された 後に 実行されるのでは ありません 。 パラメータ この関数にはパラメータはありません。 戻り値 値を返しません。 例 例1 Generator::rewind() の例 <?php function generator (): Generator { echo "I'm a generator!\n" ; for ( $i = 1 ; $i <= 3 ; $i ++) { yiel ... d $i ; } } // ジェネレータを初期化 $generator = generator (); // まだ達していない場合、最初の yield 式の開始までジェネレータを巻き戻します。 $generator -> rewind (); // ... I'm a generator! // ここでは何も起きません; ジェネレータは既に巻き戻されています。 $generator -> rewind (); // No output (NULL) // ここでは ...
https://man.mtool.work/php/8.3/generator.rewind.html
Generator クラス | PHP 8.3 12632
Generator クラス (PHP 5 >= 5.5.0, PHP 7, PHP 8) はじめに Generator は ジェネレータ が返すオブジェクトです。 警告 Generator オブジェクトのインスタンスは new では作れません。 クラス概要 final class Generator implements Iterator { /* メソッド ... mixed public function valid (): bool public function __wakeup (): void } 参考 オブジェクトの反復処理 も参照ください。 目次 Generator::current — yield した値を取得する Generator::getReturn — ジェネレータの戻り値を取得する Generator::key — yield したキーを取 ... 得する Generator::next — ジェネレータを続行する Generator::rewind — 最初の yield までジェネレータを実行する Generator::send — 値をジェネレー ... タに送る Generator::throw — 例外をジェネレータにスローする Generator::valid — イテレータが終了したかどうかを調べる Generator::__wakeup — シリ ...
https://man.mtool.work/php/8.3/class.generator.html
Generator::next — ジェネレータを続行する | PHP 8.3 10549
Generator::next (PHP 5 >= 5.5.0, PHP 7, PHP 8) Generator::next — ジェネレータを続行する 説明 public function Generator::next (): void Generator::next() のコールは、 null を引数として Generator::send() をコールすることと同じ効果があります。 ... パラメータ この関数にはパラメータはありません。 戻り値 値を返しません。 他のマニュアルの関連ページ Python email.generator Python gen Linux JM dnskeygen(1) Python 2.3 Python 2.4 Python contextlib ...
https://man.mtool.work/php/8.3/generator.next.html
Generator::key — yield したキーを取得する | PHP 8.3 9524
Generator::key (PHP 5 >= 5.5.0, PHP 7, PHP 8) Generator::key — yield したキーを取得する 説明 public function Generator::key (): mixed yield した値のキーを取得します。 パラメータ この関数にはパラメータはありません。 戻り値 yield したキーを返 ... します。 例 例1 Generator::key() の例 <?php function Gen () { yield 'key' => 'value' ; } $gen = Gen (); echo " { $gen -> key ()} => { $gen -> curren ... y => value 他のマニュアルの関連ページ Linux JM pthread_yield(3) Linux JM sched_yield(2) Python 2.3 Python 3.3 Python email.generator Python contextlib ...
https://man.mtool.work/php/8.3/generator.key.html
Generator::current — yield した値を取得する | PHP 8.3 9233
Generator::current (PHP 5 >= 5.5.0, PHP 7, PHP 8) Generator::current — yield した値を取得する 説明 public function Generator::current (): mixed パラメータ この関数にはパラメータはありません。 戻り値 yield した値を返します。 他のマニュアルの ... 関連ページ Linux JM pthread_yield(3) Linux JM sched_yield(2) Python 2.3 Python email.generator Python 3.3 Linux JM dnskeygen(1) ...
https://man.mtool.work/php/8.3/generator.current.html
Generator::__wakeup — シリアライズのコールバック | PHP 8.3 9171
Generator::__wakeup (PHP 5 >= 5.5.0, PHP 7, PHP 8) Generator::__wakeup — シリアライズのコールバック 説明 public function Generator::__wakeup (): void ジェネレータはシリアライズできないので、例外をスローします。 パラメータ この関数にはパラメ ... ータはありません。 戻り値 値を返しません。 他のマニュアルの関連ページ Python email.generator Linux JM dnskeygen(1) Django serialization Python zoneinfo ...
https://man.mtool.work/php/8.3/generator.wakeup.html
Generator::valid — イテレータが終了したかどうかを調べる | PHP 8.3 9125
Generator::valid (PHP 5 >= 5.5.0, PHP 7, PHP 8) Generator::valid — イテレータが終了したかどうかを調べる 説明 public function Generator::valid (): bool パラメータ この関数にはパラメータはありません。 戻り値 イテレータが終了した場合に false を ... 返します。まだ終了していない場合は true を返します。 他のマニュアルの関連ページ Python email.generator Linux JM dnskeygen(1) Python iter Python iterator Python functional ...
https://man.mtool.work/php/8.3/generator.valid.html
Generator::getReturn — ジェネレータの戻り値を取得する | PHP 8.3 8789
Generator::getReturn (PHP 7, PHP 8) Generator::getReturn — ジェネレータの戻り値を取得する 説明 public function Generator::getReturn (): mixed パラメータ この関数にはパラメータはありません。 戻り値 ジェネレータの実行が終了すると、その戻り値を ... 返します。 例 例1 Generator::getReturn() の例 <?php $gen = (function() { yield 1 ; yield 2 ; return 3 ; })(); foreach ( $gen as $val ) { echo $val , P ...
https://man.mtool.work/php/8.3/generator.getreturn.html
Generator::send — 値をジェネレータに送る | PHP 8.3 8789
Generator::send (PHP 5 >= 5.5.0, PHP 7, PHP 8) Generator::send — 値をジェネレータに送る 説明 public function Generator::send ( mixed $value ): mixed 指定した値を yield の結果としてジェネレータに送り、ジェネレータを続行します。 ジェネレータが ... れると、 まずは最初の yield 式まで進めてから値を送信します。そのため、 PHP のジェネレータでは、(Python で行われているような) Generator::next() の呼び出しで「呼び水を与える」必要はありません。 パラメータ value ジェネレータに送り込む値。この値が、ジェネレータ ... が現在指している yield 式の戻り値になります。 戻り値 yield した値を返します。 例 例1 Generator::send() による値の注入 <?php function printer () { echo "I'm printer!" . PHP_EOL ; while ( true ) { $string = yield; echo ...
https://man.mtool.work/php/8.3/generator.send.html
ReflectionGenerator::getExecutingGenerator — 実行中の Generator | PHP 8.3 8589
ReflectionGenerator::getExecutingGenerator (PHP 7, PHP 8) ReflectionGenerator::getExecutingGenerator — 実行中の Generator オブジェクトを取得する 説明 public function ReflectionGenerator::getExecutingGenerator (): Generator 実行中の Generator ... r オブジェクトを取得します。 パラメータ この関数にはパラメータはありません。 戻り値 現在実行中の Generator オブジェクトを返します。 例 例1 ReflectionGenerator::getExecutingGenerator() の例 <?php class GenExample { public function ... gen () { yield 1 ; } } $gen = (new GenExample )-> gen (); $reflectionGen = new ReflectionGenerator ( $gen ); $gen2 = $reflectionGen -> getExecutingGenerator (); var_dump ( $gen2 === $gen ); var_dump ( $gen2 -> current ()) ... ; 上の例の出力は、 たとえば以下のようになります。 bool(true) int(1); 参考 ReflectionGenerator::getExecutingLine() - 現在実行中のジェネレータの行を取得する ReflectionGenerator::getExecutingFile() - 現在実行中のジェネレ ...
https://man.mtool.work/php/8.3/reflectiongenerator.getexecutinggenerator.html
PREV 1 2 3 4 5 NEXT