PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

ReflectionClass::getProperty

(PHP 5)

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

Description

public ReflectionProperty ReflectionClass::getProperty ( string $name )

Gets a ReflectionProperty for a class's property.

Parameters

name

The property name.

Return Values

A ReflectionProperty.

Examples

Example #1 Basic usage of ReflectionClass::getProperty

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

The above example will output:

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

See Also

PHP Manual