ReflectionFunction::__toString

(PHP 5, PHP 7, PHP 8)

ReflectionFunction::__toStringDevuelve una representación textual del objeto ReflectionFunction

Descripción

public ReflectionFunction::__toString(): string

Obtiene una representación textual legible por humanos de la función, sus argumentos y su valor de retorno.

Parámetros

Esta función no tiene parámetros.

Valores devueltos

La cadena.

Ejemplos

Ejemplo #1 Ejemplo para ReflectionFunction::__toString()

<?php
function title($title, $name)
{
return
sprintf("%s. %s\r\n", $title, $name);
}

echo new
ReflectionFunction('title');
?>

El resultado del ejemplo sería algo similar a:

Function [ <user> function title ] {
  @@ Command line code 1 - 1

  - Parameters [2] {
    Parameter #0 [ <required> $title ]
    Parameter #1 [ <required> $name ]
  }
}

Ver también