update : 2015.11.03
php.shukuma.com

검색:
 
 
Gets a ReflectionProperty for a class's property

ReflectionClass::getProperty

(PHP 5)

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

설명

public ReflectionProperty ReflectionClass::getProperty ( string $name )

Gets a ReflectionProperty for a class's property.

인수

name

The property name.

반환값

A ReflectionProperty.

예제

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

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

위 예제의 출력:

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

참고