Results of 1 - 10 of about 80 for closure (0.001 sec.)
- Closure クラス | PHP 8.3 12013
- Closure クラス (PHP 5 >= 5.3.0, PHP 7, PHP 8) はじめに 無名関数 を表すために使うクラスです。 無名関数は、Closure 型のオブジェクトを生成します。 このクラスにはメソッドが用意され、 生成した無名関数をさらにコントロールできるようになっています。
... 装した他のクラスとの一貫性を保つためのものであり、 関数をコールするときにこのメソッドは使われません。 クラス概要 final class Closure { /* メソッド */ private function __construct () public static function bind ( Closure $closure , ? object $newThis , obje ... ct | string | null $newScope = "static" ): ? Closure public function bindTo ( ? object $newThis , object | string | null $newScope = "static" ): ? Closure public function call ... ( object $newThis , mixed ...$args ): mixed public static function fromCallable ( callable $callback ): Closure public static function getCurrent (): Closure } 変更履歴 バージョン 説明 8.4.0 Closure::__debugInfo() の出力に、 クロージャ ...
-
https://man.mtool.work/php/8.3/class.closure.html
- Closure::bind — バインドされたオブジェクトとクラスのスコープでクロージャを複製... 11396
- Closure::bind (PHP 5 >= 5.4.0, PHP 7, PHP 8) Closure::bind — バインドされたオブジェクトとクラスのスコープでクロージャを複製する 説明 public static function Closure::bind ( Closure $closure , ? object $newThis , object | string | null $newSc
... ope = "static" ): ? Closure このメソッドは、staticメソッド版の Closure::bindTo() です。 詳細な説明は Closure::bindTo() のドキュメントを参照ください。 ... パラメータ closure バインドする無名関数。 newThis 指定した無名関数をバインドするオブジェクト。クロージャのバインドを解除するには null を指定し ... private メソッドのアクセス権を決めます。 このパラメータに、内部クラスのオブジェクトを渡すことはできません。 戻り値 新しい Closure オブジェクトを返します。 失敗した場合は null を返します。 変更履歴 バージョン 説明 8.5.0 インスタンスを static なクロージャ ...
-
https://man.mtool.work/php/8.3/closure.bind.html
- IntlChar::getFC_NFKC_Closure — コードポイントの FC_NFKC_Closure プロパティの値... 9985
- IntlChar::getFC_NFKC_Closure (PHP 7, PHP 8) IntlChar::getFC_NFKC_Closure — コードポイントの FC_NFKC_Closure プロパティの値を取得する 説明 public static function IntlChar::getFC_NFKC_Closure ( int | string $codepoint ): string | false | null
... コードポイントの FC_NFKC_Closure プロパティの値を文字列で取得します。 パラメータ codepoint コードポイントを表す int 型の値 (例: U+2603 SNOWMAN を表す 0x260 ... 3 )、あるいは UTF-8 文字列としてエンコードされた文字 (例: "\u{2603}" )。 戻り値 codepoint の FC_NFKC_Closure プロパティの値を文字列で返します。 値が存在しない場合は、空文字列を返します。 失敗した場合は、 null または false を返します ... 。 例 例1 さまざまなコードポイントの例 <?php var_dump ( IntlChar :: getFC_NFKC_Closure ( "\u{2121}" )); var_dump ( IntlChar :: getFC_NFKC_Closure ( "\u{1D2D}" )); ?> 上の例の出力は以下となります。 string(3) "t ...
-
https://man.mtool.work/php/8.3/intlchar.getfc-nfkc-closure.html
- Closure::getCurrent — 現在実行中のクロージャを返す | PHP 8.3 9931
- Closure::getCurrent (PHP 8 >= 8.5.0) Closure::getCurrent — 現在実行中のクロージャを返す 説明 public static function Closure::getCurrent (): Closure 現在実行中のクロージャを返します。このメソッドは主に、 use キーワードを使ってクロージャ変数へ
... ドはクロージャの内部から呼び出す必要があります。 クロージャのコンテキスト外から呼び出すと、 Error: Current function is not a closure. が発生します。 パラメータ この関数にはパラメータはありません。 戻り値 現在実行中の Closure を返します。 エラー / 例外 クロ ... ージャのコンテキスト外から呼び出された場合、 Error をスローします。 例 例1 Closure::getCurrent() の例 Closure::getCurrent() を使って 再帰的なフィボナッチ関数を実装する例: <?php $fibonacci = function ( int ... $n ) { if ( $n === 0 || $n === 1 ) { return $n ; } $fn = Closure :: getCurrent (); return $fn ( $n - 1 ) + $fn ( $n - 2 ); }; echo $fibonacci ( 10 ); // 出力: 55 ?> 例2 従来のアプローチと ...
-
https://man.mtool.work/php/8.3/closure.getcurrent.html
- Closure::call — クロージャを束縛して呼び出す | PHP 8.3 9478
- Closure::call (PHP 7, PHP 8) Closure::call — クロージャを束縛して呼び出す 説明 public function Closure::call ( object $newThis , mixed ...$args ): mixed クロージャを一時的に newThis に束縛し、 指定したパラメータでそれを呼び出します。 パラメ
... オブジェクト。 args クロージャに渡すパラメータがある場合は、ここで指定します。 戻り値 クロージャの戻り値を返します。 例 例1 Closure::call() の例 <?php class Value { protected $value ; public function __construct ( $value ) { $this -> value = $value ; } p ... ublic function getValue () { return $this -> value ; } } $three = new Value ( 3 ); $four = new Value ( 4 ); $closure = function ( $delta ) { var_dump ( $this -> getValue () + $delta ); }; $closure -> call ( $three , 4 ); $closure -> call ( ...
-
https://man.mtool.work/php/8.3/closure.call.html
- コールバック / Callable | PHP 8.3 9177
- コールバック / Callable callable は、 別の関数への引数として渡される関数またはメソッドを参照するものです。 これらは、 callable 型を宣言することで表されます。 <?php function foo (callable $callback ) { $callback (); } ?> 関数によっては、コー
... て渡すことができますし、 直接呼び出すこともできます。 callable 型は、 クラスのプロパティの型宣言には使えません。 代わりに、 Closure を型宣言に使ってください。 callable は、複数の異なる方法で作成できます: Closure オブジェクト 関数またはメソッドの名前を含む ... ス名または object をインデックス 0 に、メソッド名をインデックス 1 に含みます。 __invoke() マジックメソッドを実装した object Closure オブジェクトは、 無名関数 、 アロー関数 、 第一級callableを生成する記法 、 もしくは Closure::fromCallable() メソッドを使っ ... て作成できます。 注意 : 第一級callableを生成する記法 は、PHP 8.1.0 以降でのみ利用可能です。 例1 Closure を使ったコールバックの例 <?php // Using anonymous function syntax $double1 = function ( $a ) { return $a * 2 ; }; // Using ...
-
https://man.mtool.work/php/8.3/language.types.callable.html
- The parallel\Channel class | PHP 8.3 8917
- The parallel\Channel class (0.9.0) Unbuffered Channels An unbuffered channel will block on calls to parallel\Channel::send() until there is a receiver, and block on calls to parallel\Channel::recv() until there is a sender. This means an un
... Channel::send() until capacity is reached, calls to parallel\Channel::recv() will block until there is data in the buffer. Closures over Channels A powerful feature of parallel channels is that they allow the exchange of closures between tasks (and runt ... imes). When a closure is sent over a channel the closure is buffered, it doesn't change the buffering of the channel transmitting the closure, b ... ut it does effect the static scope inside the closure: The same closure sent to different runtimes, or the same runtime, will not share their static scope. This means that when ...
-
https://man.mtool.work/php/8.3/class.parallel-channel.html
- uopz_set_return — Provide a return value for an existing function | PHP 8.3 8876
- uopz_set_return (PECL uopz 5, PECL uopz 6, PECL uopz 7) uopz_set_return — Provide a return value for an existing function 説明 function uopz_set_return ( string $function , mixed $value , bool $execute = false ): bool function uopz_set_retu
... ng $function , mixed $value , bool $execute = false ): bool Sets the return value of the function to value . If value is a Closure and execute is set, the Closure will be executed in place of the original function. It is possible to call the original fu ... nction from the Closure. 注意 : This function replaces uopz_rename() . パラメータ class The name of the class containing the function function The ... name of an existing function value The value the function should return. If a Closure is provided and the execute flag is set, the Closure will be executed in place of the original function. execute If true, ...
-
https://man.mtool.work/php/8.3/function.uopz-set-return.html
- Componere\Definition::getClosure — Get Closure | PHP 8.3 8561
- Componere\Definition::getClosure (Componere 2 >= 2.1.0) Componere\Definition::getClosure — Get Closure 説明 public function Componere\Definition::getClosure ( string $name ): Closure Shall return a Closure for the method specified by name パ
... ラメータ name The case insensitive name of the method 戻り値 A Closure bound to the correct scope Exceptions 警告 Shall throw RuntimeException if Definition was registered 警告 Shall throw Runt ...
-
https://man.mtool.work/php/8.3/componere-definition.getclosure.html
- Componere\Patch::getClosure — Get Closure | PHP 8.3 8561
- Componere\Patch::getClosure (Componere 2 >= 2.1.0) Componere\Patch::getClosure — Get Closure 説明 public function Componere\Patch::getClosure ( string $name ): Closure Shall return a Closure for the method specified by name パラメータ name
... The case insensitive name of the method 戻り値 A Closure bound to the correct scope and object Exceptions 警告 Shall throw RuntimeException if name could not be found 他のマニュア ...
-
https://man.mtool.work/php/8.3/componere-patch.getclosure.html