CakeFest 2024: The Official CakePHP Conference

ReflectionMethod::__toString

(PHP 5, PHP 7, PHP 8)

ReflectionMethod::__toStringReturns the string representation of the Reflection method object

Beschreibung

public ReflectionMethod::__toString(): string

Returns the string representation of the Reflection method object.

Parameter-Liste

Diese Funktion besitzt keine Parameter.

Rückgabewerte

A string representation of this ReflectionMethod instance.

Beispiele

Beispiel #1 ReflectionMethod::__toString() example

<?php
class HelloWorld {

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

}

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

Das oben gezeigte Beispiel erzeugt folgende Ausgabe:

Method [ <user> public method sayHelloTo ] {
  @@ /var/www/examples/reflection.php 16 - 18

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

Siehe auch

add a note

User Contributed Notes

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