ReflectionClass::getMethod

(PHP 5, PHP 7)

ReflectionClass::getMethodGets a ReflectionMethod for a class method

Descrierea

public ReflectionClass::getMethod ( string $name ) : ReflectionMethod

Gets a ReflectionMethod for a class method.

Parametri

name

The method name to reflect.

Valorile întoarse

A ReflectionMethod.

Erori/Excepții

A ReflectionException if the method does not exist.

Exemple

Example #1 Basic usage of ReflectionClass::getMethod()

<?php
$class 
= new ReflectionClass('ReflectionClass');
$method $class->getMethod('getMethod');
var_dump($method);
?>

Exemplul de mai sus va afișa:

object(ReflectionMethod)#2 (2) {
  ["name"]=>
  string(9) "getMethod"
  ["class"]=>
  string(15) "ReflectionClass"
}

A se vedea și