« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 10 of about 25 for getProperty (0.001 sec.)
ReflectionClass::getProperty — クラスのプロパティを表す ReflectionProperty | PH... 13217
ReflectionClass::getProperty (PHP 5, PHP 7, PHP 8) ReflectionClass::getProperty — クラスのプロパティを表す ReflectionProperty を取得する 説明 public function ReflectionClass::getProperty ( string $name ): ReflectionProperty クラスのプロパテ ... nProperty を取得します。 パラメータ name プロパティの名前。 戻り値 ReflectionProperty を返します。 例 例1 ReflectionClass::getProperty() の基本的な使用例 <?php $class = new ReflectionClass ( 'ReflectionClass' ); $property = $class -> getProperty ( 'name' ); ...
https://man.mtool.work/php/8.3/reflectionclass.getproperty.html
ReflectionProperty::hasDefaultValue — デフォルト値が宣言されているかをチェック... 12071
ReflectionProperty::hasDefaultValue (PHP 8) ReflectionProperty::hasDefaultValue — デフォルト値が宣言されているかをチェックする 説明 public function ReflectionProperty::hasDefaultValue (): bool プロパティにデフォルト値が宣言されているかをチェ ... ing ; public function __construct () { $this -> ping = '' ; } } $ro = new ReflectionObject (new Foo ()); var_dump ( $ro -> getProperty ( 'bar' )-> hasDefaultValue ()); var_dump ( $ro -> getProperty ( 'baz' )-> hasDefaultValue ()); var_dump ( $ro -> getPrope ... rty ( 'foo' )-> hasDefaultValue ()); var_dump ( $ro -> getProperty ( 'boing' )-> hasDefaultValue ()); var_dump ( $ro -> getProperty ( 'ping' )-> hasDefaultValue ()); // 動的なプロパティ var ... _dump ( $ro -> getProperty ( 'pong' )-> hasDefaultValue ()); // 未定義のプロパティ ?> 上の例の出力は以下となります。 bool(true) bool(false) bool(true ...
https://man.mtool.work/php/8.3/reflectionproperty.hasdefaultvalue.html
ReflectionProperty::getDefaultValue — プロパティで宣言されたデフォルト値を返す ... 10212
ReflectionProperty::getDefaultValue (PHP 8) ReflectionProperty::getDefaultValue — プロパティで宣言されたデフォルト値を返す 説明 public function ReflectionProperty::getDefaultValue (): mixed プロパティに明示または黙示的に宣言されているデフォ ... c function __construct (public string $bak = "default" ) { } } $ro = new ReflectionClass ( Foo ::class); var_dump ( $ro -> getProperty ( 'bar' )-> getDefaultValue ()); var_dump ( $ro -> getProperty ( 'baz' )-> getDefaultValue ()); var_dump ( $ro -> getPrope ... rty ( 'boing' )-> getDefaultValue ()); var_dump ( $ro -> getProperty ( 'bak' )-> getDefaultValue ()); ?> 上の例の出力は以下となります。 int(1) NULL int(0) NULL 参考 ReflectionProperty::hasDef ...
https://man.mtool.work/php/8.3/reflectionproperty.getdefaultvalue.html
ReflectionProperty::getSettableType — set フックのパラメータの型を返す | PHP 8.... 9896
ReflectionProperty::getSettableType (PHP 8 >= 8.4.0) ReflectionProperty::getSettableType — set フックのパラメータの型を返す 説明 public function ReflectionProperty::getSettableType (): ? ReflectionType set フックに指定されたパラメータの型を ... ot change this' ; } public $untyped = 'silly' ; } $rClass = new \ReflectionClass ( Example ::class); var_dump ( $rClass -> getProperty ( 'basic' )-> getSettableType ()); var_dump ( $rClass -> getProperty ( 'wider' )-> getSettableType ()); var_dump ( $rClass ... -> getProperty ( 'virtual' )-> getSettableType ()); var_dump ( $rClass -> getProperty ( 'untyped' )-> getSettableType ()); ?> 上の例の出力 ...
https://man.mtool.work/php/8.3/reflectionproperty.getsettabletype.html
ReflectionProperty::isFinal — プロパティが final かどうかを判定する | PHP 8.3 9381
ReflectionProperty::isFinal (PHP 8 >= 8.4.0) ReflectionProperty::isFinal — プロパティが final かどうかを判定する 説明 public function ReflectionProperty::isFinal (): bool 警告 この関数は、 現在のところ詳細な情報はありません。引数のリストのみ ... ed int $age ; public private(set) string $job ; } $rClass = new \ReflectionClass ( Example ::class); var_dump ( $rClass -> getProperty ( 'name' )-> isFinal ()); var_dump ( $rClass -> getProperty ( 'age' )-> isFinal ()); var_dump ( $rClass -> getProperty ( ' ...
https://man.mtool.work/php/8.3/reflectionproperty.isfinal.html
ReflectionProperty::isVirtual — プロパティが仮想プロパティかどうかを判定する | ... 9282
ReflectionProperty::isVirtual (PHP 8 >= 8.4.0) ReflectionProperty::isVirtual — プロパティが仮想プロパティかどうかを判定する 説明 public function ReflectionProperty::isVirtual (): bool プロパティが仮想プロパティかどうかを判定します。 パラメー ... ティは常に仮想プロパティです public string $job ; } $rClass = new \ReflectionClass ( Example ::class); var_dump ( $rClass -> getProperty ( 'name' )-> isVirtual ()); var_dump ( $rClass -> getProperty ( 'age' )-> isVirtual ()); var_dump ( $rClass -> getProperty ...
https://man.mtool.work/php/8.3/reflectionproperty.isvirtual.html
ReflectionProperty::getValue — 値を取得する | PHP 8.3 8966
ReflectionProperty::getValue (PHP 5, PHP 7, PHP 8) ReflectionProperty::getValue — 値を取得する 説明 public function ReflectionProperty::getValue ( ? object $object = null ): mixed プロパティの値を取得します。 パラメータ object static でない ... protected $privateProperty = 'foofoo' ; } $reflectionClass = new ReflectionClass ( 'Foo' ); var_dump ( $reflectionClass -> getProperty ( 'staticProperty' )-> getValue ()); var_dump ( $reflectionClass -> getProperty ( 'property' )-> getValue (new Foo )); $re ... flectionProperty = $reflectionClass -> getProperty ( 'privateProperty' ); $reflectionProperty -> setAccessible ( true ); // PHP 8.1.0 より前のバージョンのみ、この行の実行が必 ...
https://man.mtool.work/php/8.3/reflectionproperty.getvalue.html
ReflectionProperty::setValue — プロパティの値を設定する | PHP 8.3 8667
ReflectionProperty::setValue (PHP 5, PHP 7, PHP 8) ReflectionProperty::setValue — プロパティの値を設定する 説明 public function ReflectionProperty::setValue ( ? object $object , mixed $value ): void public function ReflectionProperty::setVa ... ティにアクセスするためには、 // 最初の引数に null を渡すことが必須になっています。 $reflectionProperty = $reflectionClass -> getProperty ( 'staticProperty' ); $reflectionProperty -> setValue ( null , 'foo' ); var_dump ( Foo :: $staticProperty ); $foo = new Fo ... o ; $reflectionClass -> getProperty ( 'property' )-> setValue ( $foo , 'bar' ); var_dump ( $foo -> property ); $reflectionProperty = $reflectionClass -> getPr ...
https://man.mtool.work/php/8.3/reflectionproperty.setvalue.html
ReflectionProperty::isDefault — デフォルトプロパティであるかどうかを調べる | PH... 8551
ReflectionProperty::isDefault (PHP 5, PHP 7, PHP 8) ReflectionProperty::isDefault — デフォルトプロパティであるかどうかを調べる 説明 public function ReflectionProperty::isDefault (): bool そのプロパティがコンパイル時に宣言されたものなのか、実 ... { public $bar ; } $o = new Foo (); $o -> bar = 42 ; $o -> baz = 42 ; $ro = new ReflectionObject ( $o ); var_dump ( $ro -> getProperty ( 'bar' )-> isDefault ()); var_dump ( $ro -> getProperty ( 'baz' )-> isDefault ()); ?> 上の例の出力は以下となります。 bool ...
https://man.mtool.work/php/8.3/reflectionproperty.isdefault.html
ReflectionProperty::isDynamic — 動的なプロパティかどうかを調べる | PHP 8.3 8452
ReflectionProperty::isDynamic (PHP 8 >= 8.4.0) ReflectionProperty::isDynamic — 動的なプロパティかどうかを調べる 説明 public function ReflectionProperty::isDynamic (): bool プロパティが実行時に宣言されたものかどうか、 あるいはコンパイル時に宣 ... { public $bar ; } $o = new Foo (); $o -> bar = 42 ; $o -> baz = 42 ; $ro = new ReflectionObject ( $o ); var_dump ( $ro -> getProperty ( 'bar' )-> isDynamic ()); var_dump ( $ro -> getProperty ( 'baz' )-> isDynamic ()); ?> 上の例の出力は以下となります。 bool ...
https://man.mtool.work/php/8.3/reflectionproperty.isdynamic.html
PREV 1 2 3 NEXT