Reflection ReflectionParameter::getClass

(PHP 5, PHP 7, PHP 8)

ReflectionParameter::getClass — 반영되는 매개변수에 대한 ReflectionClass 객체를 가져오거나 null을 가져옵니다.

경고 이 함수는 PHP 8.0.0부터 더 이상 사용되지 않습니다. 이 함수에 의존하는 것은 매우 권장되지 않습니다.


설명

public ReflectionParameter::getClass(): ?ReflectionClass

반영되는 매개변수에 대한 ReflectionClass 개체를 가져오거나 null을 가져옵니다.

PHP 8.0.0부터 이 함수는 더 이상 사용되지 않으며 권장되지 않습니다. 대신 ReflectionParameter::getType()을 사용하여 매개변수의 ReflectionType을 가져온 다음 해당 객체를 조사하여 매개변수 유형을 결정하십시오.

경고 이 함수는 현재 문서화되어 있지 않습니다. 인수 목록만 사용할 수 있습니다.


매개변수

이 함수에는 매개변수가 없습니다.


반환 값

ReflectionClass 개체, 선언된 형식이 없거나 선언된 형식이 클래스나 인터페이스가 아닌 경우 null입니다.


Examples

예제 #1 ReflectionParameter 클래스 사용

                  
<?php
function foo(Exception $a) { }

$functionReflection = new ReflectionFunction('foo');
$parameters = $functionReflection->getParameters();
$aParameter = $parameters[0];

echo $aParameter->getClass()->name;
?>
                  
                

기타