« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 10 of about 113 for return match (0.003 sec.)
return (1852), match (394)
match 10933
« switch declare » PHP Manual 制御構造 match 検索 match (PHP 8) match 式は、値の一致をチェックした結果に基づいて評価結果を分岐します。 switch 文と似ていますが、 match 式は複数の候補と比較される制約式を持ちます。 switch 文とは異なり、 三項演 ... 子のように値を評価します。 switch 文とは異なり、 弱い比較( == )ではなく、 型と値の一致チェック( === ) に基づいて行われます。 match 式は PHP 8.0.0 以降で利用可能です。 例1 match 式の構造 <?php $return_value = match ( 制約式 ) { 単一の条件式 => 返却式 , 条 ... 件式1 , 条件式2 => 返却式 , }; 例2 基本的な match 式の使い方 <?php $food = 'cake' ; $return_value = match ( $food ) { 'apple' => 'This food is an apple' , 'bar' => 'This fo ... od is a bar' , 'cake' => 'This food is a cake' , }; var_dump ( $return_value ); 上の例の出力は以下となります。 string(19) "This food is a cake" 例3 比較演算子と match 式を一緒に使う例 <?php $ag ...
https://man.mtool.work/php/8.3/control-structures.match.html
match 10802
« switch declare » PHP Manual 制御構造 match 検索 match (PHP 8) match 式は、値の一致をチェックした結果に基づいて評価結果を分岐します。 switch 文と似ていますが、 match 式は複数の候補と比較される制約式を持ちます。 switch 文とは異なり、 三項演 ... 子のように値を評価します。 switch 文とは異なり、 弱い比較( == )ではなく、 型と値の一致チェック( === ) に基づいて行われます。 match 式は PHP 8.0.0 以降で利用可能です。 例1 match 式の構造 <?php $return_value = match ( 制約式 ) { 単一の条件式 => 返却式 , 条 ... 件式1 , 条件式2 => 返却式 , }; 例2 基本的な match 式の使い方 <?php $food = 'cake' ; $return_value = match ( $food ) { 'apple' => 'This food is an apple' , 'bar' => 'This fo ... od is a bar' , 'cake' => 'This food is a cake' , }; var_dump ( $return_value ); 上の例の出力は以下となります。 string(19) "This food is a cake" 例3 比較演算子と match 式を一緒に使う例 <?php $ag ...
https://man.mtool.work/php/8.3/control-structures.match.html
Parle pattern matching 9140
« 定義済み定数 例 » PHP Manual Parle Parle pattern matching 検索 Parle pattern matching Parle supports regex matching similar to flex. Also supported are the following POSIX character sets: [:alnum:] , [:alpha:] , [:blank:] , [:cntrl:] , [: ... arle-utf32 to make them available. A particular encoding can be mapped with a correctly constructed regex. For example, to match the EURO symbol encoded in UTF-8, the regular expression [\xe2][\x82][\xac] can be used. The pattern for an UTF-8 encoded ... racter representations Sequence Description \a Alert (bell). \b Backspace. \e ESC character, \x1b. \n Newline. \r Carriage return. \f Form feed, \x0c. \t Horizontal tab, \x09. \v Vertical tab, \x0b. \oct Character specified by a three-digit octal code. ... ion and repetition Alternation and repetition Sequence Greedy Description ...|... - Try sub-patterns in alternation. * yes Match 0 or more times. + yes Match 1 or more times. ? yes Match 0 or 1 times. {n} no Match exactly n times. {n,} yes Match at le ...
https://man.mtool.work/php/8.3/parle.pattern.matching.html
Parle pattern matching 9106
« 定義済み定数 例 » PHP Manual Parle Parle pattern matching 検索 Parle pattern matching Parle supports regex matching similar to flex. Also supported are the following POSIX character sets: [:alnum:] , [:alpha:] , [:blank:] , [:cntrl:] , [: ... arle-utf32 to make them available. A particular encoding can be mapped with a correctly constructed regex. For example, to match the EURO symbol encoded in UTF-8, the regular expression [\xe2][\x82][\xac] can be used. The pattern for an UTF-8 encoded ... racter representations Sequence Description \a Alert (bell). \b Backspace. \e ESC character, \x1b. \n Newline. \r Carriage return. \f Form feed, \x0c. \t Horizontal tab, \x09. \v Vertical tab, \x0b. \oct Character specified by a three-digit octal code. ... ion and repetition Alternation and repetition Sequence Greedy Description ...|... - Try sub-patterns in alternation. * yes Match 0 or more times. + yes Match 1 or more times. ? yes Match 0 or 1 times. {n} no Match exactly n times. {n,} yes Match at le ...
https://man.mtool.work/php/8.3/parle.pattern.matching.html
例 7729
« 定義済み定数 Rar 関数 » PHP Manual Rar 例 検索 例 rar:// ラッパー の例も参照ください。 例1 オンザフライでの復元 <?php if (! array_key_exists ( "i" , $_GET ) || ! is_numeric ( $_GET [ "i" ])) die( "Index unspecified or non-numeric" ); $ind ... onger needed; stream is independent function detectUserAgent () { if (! array_key_exists ( 'HTTP_USER_AGENT' , $_SERVER )) return "Other" ; $uas = $_SERVER [ 'HTTP_USER_AGENT' ]; if ( preg_match ( "@Opera/@" , $uas )) return "Opera" ; if ( preg_match ( ... "@Firefox/@" , $uas )) return "Firefox" ; if ( preg_match ( "@Chrome/@" , $uas )) return "Chrome" ; if ( preg_match ( "@MSIE ([0-9.]+);@" , $uas , $matc ... hes )) { if (((float) $matches [ 1 ]) >= 7.0 ) return "IE" ; } return "Other" ; } /* * We have 3 options: * - For FF and Opera, which support RFC 2231, ...
https://man.mtool.work/php/8.3/rar.examples.html
例 7694
« 定義済み定数 Rar 関数 » PHP Manual Rar 例 検索 例 rar:// ラッパー の例も参照ください。 例1 オンザフライでの復元 <?php if (! array_key_exists ( "i" , $_GET ) || ! is_numeric ( $_GET [ "i" ])) die( "Index unspecified or non-numeric" ); $ind ... onger needed; stream is independent function detectUserAgent () { if (! array_key_exists ( 'HTTP_USER_AGENT' , $_SERVER )) return "Other" ; $uas = $_SERVER [ 'HTTP_USER_AGENT' ]; if ( preg_match ( "@Opera/@" , $uas )) return "Opera" ; if ( preg_match ( ... "@Firefox/@" , $uas )) return "Firefox" ; if ( preg_match ( "@Chrome/@" , $uas )) return "Chrome" ; if ( preg_match ( "@MSIE ([0-9.]+);@" , $uas , $matc ... hes )) { if (((float) $matches [ 1 ]) >= 7.0 ) return "IE" ; } return "Other" ; } /* * We have 3 options: * - For FF and Opera, which support RFC 2231, ...
https://man.mtool.work/php/8.3/rar.examples.html
列挙型とメソッド 7519
« 値に依存した列挙型(Backed Enum) 列挙型と static メソッド » PHP Manual 列挙型(Enum) 列挙型とメソッド 検索 列挙型とメソッド 列挙型では、(Pure Enum と Backed Enum ともに) メソッドを含めることもできますし、 インターフェイスを実装することもでき ... case Diamonds ; case Clubs ; case Spades ; // インターフェイスの規約を満たすための実装 public function color (): string { return match ( $this ) { Suit :: Hearts , Suit :: Diamonds => 'Red' , Suit :: Clubs , Suit :: Spades => 'Black' , }; } // インター ... フェイスの一部ではないが、正しいコード public function shape (): string { return "Rectangle" ; } } function paint ( Colorful $c ) { print $c -> color () . "\n" ; } paint ( Suit :: Clubs ); // 動作します ... se Clubs = 'C' ; case Spades = 'S' ; // インターフェイスの規約を満たすための実装 public function color (): string { return match ( $this ) { Suit :: Hearts , Suit :: Diamonds => 'Red' , Suit :: Clubs , Suit :: Spades => 'Black' , }; } } メソッドの内部 ...
https://man.mtool.work/php/8.3/language.enumerations.methods.html
Allows grouping of documents that match the given query 7189
« SolrQuery::addGroupFunction SolrQuery::addGroupSortField » PHP Manual SolrQuery Allows grouping of documents that match the given query 検索 SolrQuery::addGroupQuery (PECL solr >= 2.2.0) SolrQuery::addGroupQuery — Allows grouping of docum ... ents that match the given query 説明 public function SolrQuery::addGroupQuery ( string $value ): SolrQuery Allows grouping of documents th ... at match the given query. Adds query to the group.query parameter パラメータ value 戻り値 SolrQuery 参考 SolrQuery::setGroup() - En ... rQuery::setGroupOffset() - Sets the group.offset parameter SolrQuery::setGroupLimit() - Specifies the number of results to return for each group. The server default value is 1 SolrQuery::setGroupMain() - If true, the result of the first field grouping ...
https://man.mtool.work/php/8.3/solrquery.addgroupquery.html
Allows grouping of documents that match the given query 7189
« SolrQuery::addGroupFunction SolrQuery::addGroupSortField » PHP Manual SolrQuery Allows grouping of documents that match the given query 検索 SolrQuery::addGroupQuery (PECL solr >= 2.2.0) SolrQuery::addGroupQuery — Allows grouping of docum ... ents that match the given query 説明 public function SolrQuery::addGroupQuery ( string $value ): SolrQuery Allows grouping of documents th ... at match the given query. Adds query to the group.query parameter パラメータ value 戻り値 SolrQuery 参考 SolrQuery::setGroup() - En ... rQuery::setGroupOffset() - Sets the group.offset parameter SolrQuery::setGroupLimit() - Specifies the number of results to return for each group. The server default value is 1 SolrQuery::setGroupMain() - If true, the result of the first field grouping ...
https://man.mtool.work/php/8.3/solrquery.addgroupquery.html
トレイト 7134
« 列挙型と定数 定数式における列挙型の値 » PHP Manual 列挙型(Enum) トレイト 検索 トレイト 列挙型ではトレイトを使えます。 列挙型におけるトレイトは、クラスにおけるそれと同じ振る舞いをします。 注意すべきことは、列挙型で use されるトレイトには、 ... ます。 <?php interface Colorful { public function color (): string ; } trait Rectangle { public function shape (): string { return "Rectangle" ; } } enum Suit implements Colorful { use Rectangle ; case Hearts ; case Diamonds ; case Clubs ; case Spades ; ... public function color (): string { return match ( $this ) { Suit :: Hearts , Suit :: Diamonds => 'Red' , Suit :: Clubs , Suit :: Spades => 'Black' , }; } } $suit = ... suit プロパティ Colorful shape Hearts Diamonds Clubs dump Enum static 致命的 interface trait return enum implements return match ...
https://man.mtool.work/php/8.3/language.enumerations.traits.html
PREV 1 2 3 4 5 6 7 8 9 10 NEXT