Reflection ReflectionClass::getProperty
(PHP 5, PHP 7, PHP 8)
ReflectionClass::getProperty — 클래스 속성에 대한 ReflectionProperty를 가져옵니다.
설명
public ReflectionClass::getProperty(string $name
): ReflectionProperty
클래스 속성에 대한 ReflectionProperty를 가져옵니다.
매개변수
name
- 속성 이름입니다.
반환 값
Examples
예제 #1 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" }
기타
- ReflectionClass::getProperties() - 속성 가져오기