ReflectionClass::getProperty
(PHP 5, PHP 7)
ReflectionClass::getProperty — クラスのプロパティを表す ReflectionProperty を取得する
説明
public ReflectionClass::getProperty
( string $name
) : ReflectionProperty
クラスのプロパティを表す ReflectionProperty を取得します。
パラメータ
name
- プロパティの名前。
例
例1 ReflectionClass::getProperty() の基本的な使用例
<?php$class = new ReflectionClass('ReflectionClass');$property = $class->getProperty('name');var_dump($property);?>
上の例の出力は以下となります。
object(ReflectionProperty)#2 (2) { ["name"]=> string(4) "name" ["class"]=> string(15) "ReflectionClass" }