update : 2015.11.03
php.shukuma.com

검색:
 
 
Gets a ReflectionMethod for a class method.

ReflectionClass::getMethod

(PHP 5)

ReflectionClass::getMethodGets a ReflectionMethod for a class method.

설명

public ReflectionMethod ReflectionClass::getMethod ( string $name )

Gets a ReflectionMethod for a class method.

인수

name

The method name to reflect.

반환값

A ReflectionMethod.

오류/예외

A ReflectionException if the method does not exist.

예제

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

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

위 예제의 출력:

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

참고