(PHP 5, PHP 7, PHP 8)
ReflectionParameter::getClass — Get a ReflectionClass object for the parameter being reflected or null
Diese Funktion ist seit PHP 8.0.0 als DEPRECATED (veraltet) markiert. Von der Verwendung dieser Funktion wird dringend abgeraten.
Gets a ReflectionClass object for the parameter being reflected or null
.
As of PHP 8.0.0 this function is deprecated and not recommended. Instead, use ReflectionParameter::getType() to get the ReflectionType of the parameter, then interrogate that object to determine the parameter type.
Diese Funktion ist bis jetzt nicht dokumentiert. Es steht nur die Liste der Parameter zur Verfügung.
Diese Funktion besitzt keine Parameter.
A ReflectionClass object, or null
if no type is declared,
or the declared type is not a class or interface.
Beispiel #1 Using the ReflectionParameter class
<?php
function foo(Exception $a) { }
$functionReflection = new ReflectionFunction('foo');
$parameters = $functionReflection->getParameters();
$aParameter = $parameters[0];
echo $aParameter->getClass()->name;
?>