PHP 8.5.0 Alpha 2 available for testing

ReflectionMethod::__toString

(PHP 5, PHP 7, PHP 8)

ReflectionMethod::__toStringDevuelve una representación textual del método

Descripción

public ReflectionMethod::__toString(): string

Obtiene una representación textual del método.

Parámetros

Esta función no contiene ningún parámetro.

Valores devueltos

Una representación textual de este objeto ReflectionMethod.

Ejemplos

Ejemplo #1 ReflectionMethod::__toString() ejemplo

<?php
class HelloWorld {

public function
sayHelloTo($name) {
return
'Hello ' . $name;
}

}

$reflectionMethod = new ReflectionMethod(new HelloWorld(), 'sayHelloTo');
echo
$reflectionMethod;
?>

El ejemplo anterior mostrará :

Method [ <user> método público sayHelloTo ] {
  @@ /var/www/examples/reflection.php 16 - 18

  - Parámetros [1] {
    Parámetro #0 [ <required> $name ]
  }
}

Ver también

add a note

User Contributed Notes

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