ReflectionType::__toString

(PHP 7)

ReflectionType::__toStringTo string

Advertencia

Esta función ha sido declarada OBSOLETA a partir de PHP 7.1.0. Su uso está totalmente desaconsejado.

Descripción

public ReflectionType::__toString ( void ) : string

Gets the parameter type name.

Parámetros

Esta función no tiene parámetros.

Valores devueltos

Returns the type of the parameter.

Ejemplos

Ejemplo #1 ReflectionType::__toString() example

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

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

echo 
$reflectionParam->getType();

El resultado del ejemplo sería algo similar a:

string

Ver también