« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 2 of about 2 for classConstant (0.001 sec.)
ReflectionClassConstant::getAttributes — アトリビュートを取得する | PHP 8.3 11228
ReflectionClassConstant::getAttributes (PHP 8) ReflectionClassConstant::getAttributes — アトリビュートを取得する 説明 public function ReflectionClassConstant::getAttributes ( ? string $name = null , int $flags = 0 ): array このクラス定数上で ... ribute ] class Fruit { } #[ Attribute ] class Red { } class Basket { #[ Fruit ] #[ Red ] public const APPLE = 'apple' ; } $classConstant = new ReflectionClassConstant ( 'Basket' , 'APPLE' ); $attributes = $classConstant -> getAttributes (); print_r ( array_ma ... ribute ] class Fruit { } #[ Attribute ] class Red { } class Basket { #[ Fruit ] #[ Red ] public const APPLE = 'apple' ; } $classConstant = new ReflectionClassConstant ( 'Basket' , 'APPLE' ); $attributes = $classConstant -> getAttributes ( 'Fruit' ); print_r ( ... uit { } #[ Attribute ] class Red implements Color { } class Basket { #[ Fruit ] #[ Red ] public const APPLE = 'apple' ; } $classConstant = new ReflectionClassConstant ( 'Basket' , 'APPLE' ); $attributes = $classConstant -> getAttributes ( 'Color' , Reflection ...
https://man.mtool.work/php/8.3/reflectionclassconstant.getattributes.html
ReflectionClassConstant::isDeprecated — クラス定数が非推奨かどうかを調べる | PH... 7485
ReflectionClassConstant::isDeprecated (PHP 8 >= 8.4.0) ReflectionClassConstant::isDeprecated — クラス定数が非推奨かどうかを調べる 説明 public function ReflectionClassConstant::isDeprecated (): bool クラス定数が非推奨かどうかを調べます。 パラ ... の関数にはパラメータはありません。 戻り値 クラス定数が非推奨なら true を、そうでなければ false を返します。 例 例1 ReflectionClassConstant::isDeprecated() の例 <?php class Basket { #[ \Deprecated ( message : 'use Basket::APPLE instead' )] public const APLE = 'a ... pple' ; public const APPLE = 'apple' ; } $classConstant = new ReflectionClassConstant ( 'Basket' , 'APLE' ); var_dump ( $classConstant -> isDeprecated ()); ?> 上の例の出力は以下と ... なります。 bool(true) 参考 Deprecated ReflectionClassConstant::getDocComment() - クラス定数のドキュメントコメントを取得する ...
https://man.mtool.work/php/8.3/reflectionclassconstant.isdeprecated.html
PREV 1 NEXT