ReflectionClass
PHP Manual

ReflectionClass::getProperty

(PHP 5)

ReflectionClass::getPropertyGets a ReflectionProperty for a class's property

Descrizione

public ReflectionProperty ReflectionClass::getProperty ( string $name )

Gets a ReflectionProperty for a class's property.

Elenco dei parametri

name

The property name.

Valori restituiti

A ReflectionProperty.

Esempi

Example #1 Basic usage of ReflectionClass::getProperty()

<?php
$class 
= new ReflectionClass('ReflectionClass');
$property $class->getProperty('name');
var_dump($property);
?>

Il precedente esempio visualizzerĂ :

object(ReflectionProperty)#2 (2) {
  ["name"]=>
  string(4) "name"
  ["class"]=>
  string(15) "ReflectionClass"
}

Vedere anche:


ReflectionClass
PHP Manual