« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 10 of about 27 for cases (0.001 sec.)
値のリスト | PHP 8.3 14400
値のリスト Pure Enum と Backed Enum は、 共に内部インターフェイス UnitEnum を実装しています。 UnitEnum には static メソッド cases() が含まれています。 cases() は、 定義されている全ての case を宣言された順に含めた配列を返します。 <?php enum ... Suit { case Hearts ; case Diamonds ; case Clubs ; case Spades ; } var_dump ( Suit :: cases ()); enum SuitBacked : string { case Hearts = 'H' ; case Diamonds = 'D' ; case Clubs = ... 'C' ; case Spades = 'S' ; } var_dump ( SuitBacked :: cases ()); 列挙型において、手動で cases() メソッドを定義すると、致命的なエラーが発 ...
https://man.mtool.work/php/8.3/language.enumerations.listing.html
UnitEnum::cases — 列挙型の case 一覧を生成する | PHP 8.3 12212
UnitEnum::cases (PHP 8 >= 8.1.0) UnitEnum::cases — 列挙型の case 一覧を生成する 説明 public static function UnitEnum::cases (): array このメソッドは列挙型の全ての case を含む配列を返します。 要素は宣言された順に並びます。 パラメータ この関数 ... 下の例は、列挙型の case がどのように返されるかを示しています。 <?php enum Suit { case Hearts ; case Diamonds ; case Clubs ; case Spades ; } var_dump ( Suit :: cases ()); 上の例の出力は以下となります。 array(4) { [0]=> enum(Suit::Hearts) [1]=> enum(Suit ...
https://man.mtool.work/php/8.3/unitenum.cases.html
expect_expectl — プロセスの出力がパターンに一致する・指定した時間が経過する・ ... 10023
expect_expectl (PECL expect >= 0.1.0) expect_expectl — プロセスの出力がパターンに一致する・指定した時間が経過する・ あるいは EOF に達するのいずれかにあてはまるまで待ち続ける 説明 function expect_expectl ( resource $expect , array $cases , a ... h[9] まで (libexpect の制限です) 保存されます。 パラメータ expect 事前に expect_popen() でオープンした Expect ストリーム。 cases expect case の配列。個々の expect case は数値添字の配列で、 以下のような形式となります。 Expect Case の配列 添字 値の型 説 ... pect.timeout" , 30 ); $stream = fopen ( "expect://scp user@remotehost:/var/log/messages /home/user/messages.txt" , "r" ); $cases = array( // array(パターン, パターンに一致した場合にこの関数が返す値) array( "password:" , "asked for password" ), array( ... "yes/no)?" , "asked for yes/no" ) ); while ( true ) { switch ( expect_expectl ( $stream , $cases )) { case "asked for password" : fwrite ( $stream , "my password\n" ); break; case "asked for yes/no" : fwrite ( $stream , ...
https://man.mtool.work/php/8.3/function.expect-expectl.html
UnitEnum インターフェイス | PHP 8.3 9414
UnitEnum インターフェイス (PHP 8 >= 8.1.0) はじめに UnitEnum インターフェイスは、 全ての列挙型に対して、PHP のエンジンが自動的に適用するものです。 ユーザー定義のクラスとして実装してはいけません。 列挙型はメソッドのオーバーライドを禁止してい ... スは、型チェックのためだけに存在しています。 インターフェイス概要 interface UnitEnum { /* メソッド */ public static function cases (): array } 目次 UnitEnum::cases — 列挙型の case 一覧を生成する 他のマニュアルの関連ページ DuckDB Caveats Django index ...
https://man.mtool.work/php/8.3/class.unitenum.html
The parallel\Runtime class | PHP 8.3 8920
The parallel\Runtime class (0.8.0) Runtime Objects Each runtime represents a single PHP thread, the thread is created (and bootstrapped) upon construction. The thread then waits for tasks to be scheduled: Scheduled tasks will be executed FI ... s) that created it. This means it doesn't have the same classes and functions loaded, nor the same autoloader set. In some cases, a very lightweight runtime is desirable because the tasks that will be scheduled do not need access to the code in the pa ... rent thread. In those cases where the tasks do need to access the same code, it is enough to set an autoloader as the bootstrap. 注意 : preloading may ...
https://man.mtool.work/php/8.3/class.parallel-runtime.html
ReflectionEnum::getCases — 列挙型の全ての case を返す | PHP 8.3 8920
ReflectionEnum::getCases (PHP 8 >= 8.1.0) ReflectionEnum::getCases — 列挙型の全ての case を返す 説明 public function ReflectionEnum::getCases (): array 列挙型には、ひとつ以上の case を含めることができます。 このメソッドは、定義済みの全ての ... se になります。 Backed Enum の場合、すべてのインスタンスが ReflectionEnumBackedCase になります。 例 例1 ReflectionEnum::getCases() の例 <?php enum Suit { case Hearts ; case Diamonds ; case Clubs ; case Spades ; } $rEnum = new ReflectionEnum ( Suit ::c ... lass); $cases = $rEnum -> getCases (); foreach ( $cases as $rCase ) { var_dump ( $rCase -> getValue ()); } ?> 上の例の出力は以下となりま ...
https://man.mtool.work/php/8.3/reflectionenum.getcases.html
Expect の使用例 | PHP 8.3 8327
Expect の使用例 例1 Expect の使用例 この例ではリモートホストに SSH 経由で接続し、接続先の稼働時間を表示します。 <?php ini_set ( "expect.loguser" , "Off" ); $stream = fopen ( "expect://ssh root@remotehost uptime" , "r" ); $cases = array ( ar ... ray ( 0 => "password:" , 1 => PASSWORD ) ); switch ( expect_expectl ( $stream , $cases )) { case PASSWORD : fwrite ( $stream , "password\n" ); break; default: die ( "リモートホストへの接続時にエラーが発生しまし ... 着きました! ))) { case PASSWORD : fwrite ( $stream , "secret\n" ); break; case YESNO : fwrite ( $stream , "yes\n" ); break; case SHELL : fwrite ( $stream , "uname -a\n" ); while ( true ) { switch ( expect_expectl ( $stream , array ( array ( "~$ " , SHE ... array ( "^Linux.*$" , UNAME , EXP_REGEXP ), // uname -a の出力 ), $match )) { case UNAME : $uname .= $match [ 0 ]; break; case SHELL : // アップデートの実行 if ( strstr ( $uname , "x86_64" )) { fwrite ( $stream , "rpm -Uhv http://mirrorsite/somepath/ ...
https://man.mtool.work/php/8.3/expect.examples-usage.html
EventBufferEvent::close — Closes file descriptor associated with the current bu... 8080
EventBufferEvent::close (PECL event >= 1.10.0) EventBufferEvent::close — Closes file descriptor associated with the current buffer event 説明 public function EventBufferEvent::close (): void Closes file descriptor associated with the curren ... t buffer event. This method may be used in cases when the EventBufferEvent::OPT_CLOSE_ON_FREE option is not appropriate. パラメータ この関数にはパラメータはありません。 戻 ...
https://man.mtool.work/php/8.3/eventbufferevent.close.html
EventBufferEvent::free — Free a buffer event | PHP 8.3 7949
EventBufferEvent::free (PECL event >= 1.2.6-beta) EventBufferEvent::free — Free a buffer event 説明 public function EventBufferEvent::free (): void Free resources allocated by buffer event. Usually there is no need to call this method, sinc ... ing lots of instances, or a script with a heavy memory usage, where we need to free resources as soon as possible. In such cases EventBufferEvent::free() may be used to protect the script against running up to the memory_limit . パラメータ この関数には ...
https://man.mtool.work/php/8.3/eventbufferevent.free.html
列挙型とメソッド | PHP 8.3 7949
列挙型とメソッド 列挙型では、(Pure Enum と Backed Enum ともに) メソッドを含めることもできますし、 インターフェイスを実装することもできます。 列挙型がインターフェイスを実装する場合、 そのインターフェイスでの型チェックは、 実装した列挙型の全て ... Colorful { public function color (): string ; } enum Suit implements Colorful { case Hearts ; case Diamonds ; case Clubs ; case Spades ; // インターフェイスの規約を満たすための実装 public function color (): string { return match ( $this ) { Suit :: He ... color (): string ; } enum Suit : string implements Colorful { case Hearts = 'H' ; case Diamonds = 'D' ; case Clubs = 'C' ; case Spades = 'S' ; // インターフェイスの規約を満たすための実装 public function color (): string { return match ( $this ) { Suit ... Clubs , Suit :: Spades => 'Black' , }; } public function shape (): string { return "Rectangle" ; } public static function cases (): array { // 不正なメソッド。列挙型では、手動で cases() メソッドを定義できないからです。 // "値のリスト" のページも参照く ...
https://man.mtool.work/php/8.3/language.enumerations.methods.html
PREV 1 2 3 NEXT