PHP 8.3.4 Released!

ReflectionFunction::__toString

(PHP 5, PHP 7, PHP 8)

ReflectionFunction::__toStringRetourne une représentation textuelle de l'objet ReflectionFunction

Description

public ReflectionFunction::__toString(): string

Récupère une représentation textuelle lisible par un être humain de la fonction, ses paramètres et sa valeur de retour.

Liste de paramètres

Cette fonction ne contient aucun paramètre.

Valeurs de retour

La chaîne.

Exemples

Exemple #1 Exemple pour ReflectionFunction::__toString()

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

echo new
ReflectionFunction('title');
?>

Résultat de l'exemple ci-dessus est similaire à :

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

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

Voir aussi

add a note

User Contributed Notes

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