PHP 8.5.0 Alpha 1 available for testing

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 contiene ningún parámetro.

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');
?>

Resultado del ejemplo anterior es similar a :

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

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

Ver también

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top