ReflectionClass
PHP Manual

ReflectionClass::getProperty

(PHP 5)

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

Descrierea

public ReflectionProperty ReflectionClass::getProperty ( string $name )

Gets a ReflectionProperty for a class's property.

Parametri

name

The property name.

Valorile întoarse

A ReflectionProperty.

Exemple

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

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

Exemplul de mai sus va afișa:

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

Vedeți de asemenea


ReflectionClass
PHP Manual