ReflectionClass
PHP Manual

ReflectionClass::getMethod

(PHP 5, PHP 7)

ReflectionClass::getMethodGets a ReflectionMethod for a class method.

Descrição

public ReflectionMethod ReflectionClass::getMethod ( string $name )

Gets a ReflectionMethod for a class method.

Parâmetros

name

The method name to reflect.

Valor Retornado

A ReflectionMethod.

Erros

A ReflectionException if the method does not exist.

Exemplos

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

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

O exemplo acima irá imprimir:

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

Veja Também


ReflectionClass
PHP Manual