(PHP 5, PHP 7)
ReflectionClass::getProperty — Gets a ReflectionProperty for a class's property
Gets a ReflectionProperty for a class's property.
name
The property name.
Exemplo #1 Basic usage of ReflectionClass::getProperty()
<?php
$class = new ReflectionClass('ReflectionClass');
$property = $class->getProperty('name');
var_dump($property);
?>
O exemplo acima irá imprimir:
object(ReflectionProperty)#2 (2) { ["name"]=> string(4) "name" ["class"]=> string(15) "ReflectionClass" }