ReflectionClass
PHP Manual

ReflectionClass::getMethod

(PHP 5)

ReflectionClass::getMethodGets a ReflectionMethod for a class method.

Descrierea

public ReflectionMethod ReflectionClass::getMethod ( string $name )

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"
}

Vedeți de asemenea


ReflectionClass
PHP Manual