Results of 1 - 10 of about 30 for Thing (0.010 sec.)
- リフレクションAPI を使ってアトリビュートを読み取る 12753
- « アトリビュートの文法 アトリビュートクラスを宣言する » PHP Manual アトリビュート リフレクションAPI を使ってアトリビュートを読み取る 検索 リフレクションAPI を使ってアトリビュートを読み取る クラス、メソッド、関数、パラメータ、プロパティ、クラ
... lic $value ; public function __construct ( $value ) { $this -> value = $value ; } } #[ MyAttribute ( value : 1234 )] class Thing { } function dumpAttributeData ( $reflection ) { $attributes = $reflection -> getAttributes (); foreach ( $attributes as $ ... p ( $attribute -> getArguments ()); var_dump ( $attribute -> newInstance ()); } } dumpAttributeData (new ReflectionClass ( Thing ::class)); 上の例の出力は以下となります。 string(11) "MyAttribute" array(1) { ["value"]=> int(1234) } object(MyAttribute)# ... lic $value ; public function __construct ( $value ) { $this -> value = $value ; } } #[ MyAttribute ( value : 1234 )] class Thing { } function dumpMyAttributeData ( $reflection ) { $attributes = $reflection -> getAttributes ( MyAttribute ::class); fore ...
-
https://man.mtool.work/php/8.3/language.attributes.reflection.html
- リフレクションAPI を使ってアトリビュートを読み取る 12753
- « アトリビュートの文法 アトリビュートクラスを宣言する » PHP Manual アトリビュート リフレクションAPI を使ってアトリビュートを読み取る 検索 リフレクションAPI を使ってアトリビュートを読み取る クラス、メソッド、関数、パラメータ、プロパティ、クラ
... lic $value ; public function __construct ( $value ) { $this -> value = $value ; } } #[ MyAttribute ( value : 1234 )] class Thing { } function dumpAttributeData ( $reflection ) { $attributes = $reflection -> getAttributes (); foreach ( $attributes as $ ... p ( $attribute -> getArguments ()); var_dump ( $attribute -> newInstance ()); } } dumpAttributeData (new ReflectionClass ( Thing ::class)); 上の例の出力は以下となります。 string(11) "MyAttribute" array(1) { ["value"]=> int(1234) } object(MyAttribute)# ... lic $value ; public function __construct ( $value ) { $this -> value = $value ; } } #[ MyAttribute ( value : 1234 )] class Thing { } function dumpMyAttributeData ( $reflection ) { $attributes = $reflection -> getAttributes ( MyAttribute ::class); fore ...
-
https://man.mtool.work/php/8.3/language.attributes.reflection.html
- 名前空間の使用法: エイリアス/インポート 10641
- « namespace キーワードおよび __NAMESPACE__ グローバル空間 » PHP Manual 名前空間 名前空間の使用法: エイリアス/インポート 検索 名前空間の使用法: エイリアス/インポート (PHP 5 >= 5.3.0, PHP 7, PHP 8) 外部の完全修飾名をエイリアスで参照したりイン
... インスタンスを作成します $obj = new \Another ; // Another クラスのオブジェクトのインスタンスを作成します $obj = new Another\thing ; // My\Full\Classname\thing クラスのオブジェクトのインスタンスを作成します $obj = new \Another\thing ; // Another\thing ク ... stC }; 関連キーワード: インポート namespace 空間 インスタンス NSname エイリアス Classname 修飾 func 定数 ArrayObject subns thing スコープ 宣言 キーワード 演算子 functionName 複数 影響 規則 サポート 区切り文字 コンパイル Languages ...
-
https://man.mtool.work/php/8.3/language.namespaces.importing.html
- 文字列のコードを評価し、動的に関数を作成する 9942
- « call_user_func_array forward_static_call » PHP Manual 関数処理 関数 文字列のコードを評価し、動的に関数を作成する 検索 create_function (PHP 4 >= 4.0.1, PHP 5, PHP 7) create_function — 文字列のコードを評価し、動的に関数を作成する 警告 この関
... ) を使い、文字列を長いものから短いものに並べます: <?php $sv = array( "small" , "a big string" , "larger" , "it is a string thing" ); echo "Original:\n" ; print_r ( $sv ); echo "Sorted:\n" ; usort ( $sv , create_function ( '$a,$b' , 'return strlen($b) ... sv ); ?> 無名関数 を使うと、下記のようになります: <?php $sv = array( "small" , "a big string" , "larger" , "it is a string thing" ); echo "Original:\n" ; print_r ( $sv ); echo "Sorted:\n" ; usort ( $sv , function( $a , $b ) { return strlen ( $b ) - st ... ; ?> 上の例の出力は以下となります。 Original: Array ( [0] => small [1] => a big string [2] => larger [3] => it is a string thing ) Sorted: Array ( [0] => it is a string thing [1] => a big string [2] => larger [3] => small ) 参考 無名関数 関連キーワード ...
-
https://man.mtool.work/php/8.3/function.create-function.html
- 名前空間の使用法: エイリアス/インポート 9601
- « namespace キーワードおよび __NAMESPACE__ グローバル空間 » PHP Manual 名前空間 名前空間の使用法: エイリアス/インポート 検索 名前空間の使用法: エイリアス/インポート (PHP 5 >= 5.3.0, PHP 7, PHP 8) 外部の完全修飾名をエイリアスで参照したりイン
... インスタンスを作成します $obj = new \Another ; // Another クラスのオブジェクトのインスタンスを作成します $obj = new Another\thing ; // My\Full\Classname\thing クラスのオブジェクトのインスタンスを作成します $obj = new \Another\thing ; // Another\thing ク ...
-
https://man.mtool.work/php/8.3/language.namespaces.importing.html
- FAQ: 名前空間について知っておくべきこと 9422
- « 名前解決のルール 列挙型(Enum) » PHP Manual 名前空間 FAQ: 名前空間について知っておくべきこと 検索 FAQ: 名前空間について知っておくべきこと (PHP 5 >= 5.3.0, PHP 7, PHP 8) この FAQ は 2 つに分かれています。一般的な質問と、 深く理解するために有
... 合わせは、正当なものです。 file1.php <?php namespace my\stuff ; class MyClass {} another.php <?php namespace another ; class thing {} file2.php <?php namespace my\stuff ; include 'file1.php' ; include 'another.php' ; use another\thing as MyClass ; $a = ... new MyClass ; // 名前空間 another のクラス "thing" のインスタンスを作成します。 MyClass クラスが名前空間 my\stuff にあるとはいえ、名前の衝突はありません。 MyClass の定義は別 ... なエラーとなります。 MyClass の定義が同じファイル上の use 文で行われているからです。 <?php namespace my\stuff ; use another\thing as MyClass ; class MyClass {} // fatal error: MyClass conflicts with import statement $a = new MyClass ; 名前空間のネストは ...
-
https://man.mtool.work/php/8.3/language.namespaces.faq.html
- ファイルがグローバルなメタデータを持つかどうかを返す 9422
- « Phar::getVersion Phar::interceptFileFuncs » PHP Manual Phar ファイルがグローバルなメタデータを持つかどうかを返す 検索 Phar::hasMetadata (PHP 5 >= 5.3.0, PHP 7, PHP 8, PECL phar >= 1.2.0) Phar::hasMetadata — ファイルがグローバルなメタデータ
... () の例 <?php try { $phar = new Phar ( 'myphar.phar' ); var_dump ( $phar -> hasMetadata ()); $phar -> setMetadata (array( 'thing' => 'hi' )); var_dump ( $phar -> hasMetadata ()); $phar -> delMetadata (); var_dump ( $phar -> hasMetadata ()); } catch ( ... 連キーワード: Phar phar メタデータ hasMetadata dump setMetadata delMetadata アーカイブ getVersion interceptFileFuncs myphar thing catch Exception 参考 getMetadata グローバルメタデータ ...
-
https://man.mtool.work/php/8.3/phar.hasmetadata.html
- 文字列のコードを評価し、動的に関数を作成する 9081
- « call_user_func_array forward_static_call » PHP Manual 関数処理 関数 文字列のコードを評価し、動的に関数を作成する 検索 create_function (PHP 4 >= 4.0.1, PHP 5, PHP 7) create_function — 文字列のコードを評価し、動的に関数を作成する 警告 この関
... ) を使い、文字列を長いものから短いものに並べます: <?php $sv = array( "small" , "a big string" , "larger" , "it is a string thing" ); echo "Original:\n" ; print_r ( $sv ); echo "Sorted:\n" ; usort ( $sv , create_function ( '$a,$b' , 'return strlen($b) ... sv ); ?> 無名関数 を使うと、下記のようになります: <?php $sv = array( "small" , "a big string" , "larger" , "it is a string thing" ); echo "Original:\n" ; print_r ( $sv ); echo "Sorted:\n" ; usort ( $sv , function( $a , $b ) { return strlen ( $b ) - st ... ; ?> 上の例の出力は以下となります。 Original: Array ( [0] => small [1] => a big string [2] => larger [3] => it is a string thing ) Sorted: Array ( [0] => it is a string thing [1] => a big string [2] => larger [3] => small ) 参考 無名関数 関連キーワード ...
-
https://man.mtool.work/php/8.3/function.create-function.html
- FAQ: 名前空間について知っておくべきこと 8724
- « 名前解決のルール 列挙型(Enum) » PHP Manual 名前空間 FAQ: 名前空間について知っておくべきこと 検索 FAQ: 名前空間について知っておくべきこと (PHP 5 >= 5.3.0, PHP 7, PHP 8) この FAQ は 2 つに分かれています。一般的な質問と、 深く理解するために有
... 合わせは、正当なものです。 file1.php <?php namespace my\stuff ; class MyClass {} another.php <?php namespace another ; class thing {} file2.php <?php namespace my\stuff ; include 'file1.php' ; include 'another.php' ; use another\thing as MyClass ; $a = ... new MyClass ; // 名前空間 another のクラス "thing" のインスタンスを作成します。 MyClass クラスが名前空間 my\stuff にあるとはいえ、名前の衝突はありません。 MyClass の定義は別 ... なエラーとなります。 MyClass の定義が同じファイル上の use 文で行われているからです。 <?php namespace my\stuff ; use another\thing as MyClass ; class MyClass {} // fatal error: MyClass conflicts with import statement $a = new MyClass ; 名前空間のネストは ...
-
https://man.mtool.work/php/8.3/language.namespaces.faq.html
- 例 7846
- « 定義済み定数 Seaslog 関数 » PHP Manual Seaslog 例 検索 例 例1 Get and set base path <?php $basePath1 = SeasLog :: getBasePath (); SeasLog :: setBasePath ( '/log/base_test' ); $basePath2 = SeasLog :: getBasePath (); var_dump ( $basePath1 ,
... y( '{website}' => 'github.com' , '{action}' => 'rboot' )); SeasLog :: error ( 'a error log' ); SeasLog :: critical ( 'some thing was critical' ); SeasLog :: alert ( 'yes this is a {messageName}' ,array( '{messageName}' => 'alertMSG' )); SeasLog :: eme ... 99159975a9ff | 1406422432.787 | a error log 2014-07-27 08:53:52 | CRITICAL | 23625 | 599159975a9ff | 1406422432.787 | some thing was critical 2014-07-27 08:53:52 | EMERGENCY | 23625 | 599159975a9ff | 1406422432.787 | Just now, the house next door was ...
-
https://man.mtool.work/php/8.3/seaslog.examples.html