获取类的一个属性的 ReflectionProperty。
name
属性名。
Example #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" }
eric at naeseth dot com (2011-08-02 15:38:00)
If the class doesn't have a property with the given name, a ReflectionException will be raised.