If the class doesn't have a property with the given name, a ReflectionException will be raised.
ReflectionClass::getProperty
(PHP 5)
ReflectionClass::getProperty — Gets a ReflectionProperty for a class's property
Opis
Gets a ReflectionProperty for a class's property.
Parametry
-
name -
The property name.
Zwracane wartości
Przykłady
Przykład #1 Basic usage of ReflectionClass::getProperty()
<?php
$class = new ReflectionClass('ReflectionClass');
$property = $class->getProperty('name');
var_dump($property);
?>
Powyższy przykład wyświetli:
object(ReflectionProperty)#2 (2) {
["name"]=>
string(4) "name"
["class"]=>
string(15) "ReflectionClass"
}
eric at naeseth dot com ¶
1 year ago
