ReflectionType::__toString

To string

Beschreibung

public string ReflectionType::__toString ( void )

Gets the parameter type name.

Parameter-Liste

Diese Funktion hat keine Parameter.

Rückgabewerte

Returns the type of the parameter.

Beispiele

Beispiel #1 ReflectionType::__toString example

<?php
function someFunction(string $param) {}

$reflectionFunc = new ReflectionFunction('someFunction');
$reflectionParam $reflectionFunc->getParameters()[0];

echo 
$reflectionParam->getType();

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

string

Siehe auch

  • ReflectionType::allowsNull
  • ReflectionType::isBuiltin
  • ReflectionParameter::getType