ReflectionParameter::getClass

(PHP 5, PHP 7)

ReflectionParameter::getClassGet the type hinted class

Descrição

public ReflectionParameter::getClass ( void ) : ReflectionClass

Gets the class type hinted for the parameter as a ReflectionClass object.

Aviso

Esta função não está documentada; somente a lista de argumentos está disponível.

Parâmetros

Esta função não possui parâmetros.

Valor Retornado

A ReflectionClass object.

Exemplos

Exemplo #1 Using the ReflectionParameter class

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

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

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

O exemplo acima irá imprimir:

Exception

Veja Também