PHPマニュアル/PEARマニュアル | ユーザフォーラムで議論/質問 | マニュアル検索 | ハイライト | ハイライトオフ | ポータル | php spot

ReflectionClass::getMethod - クラスメソッドの ReflectionMethod を取得する | JavaScript入門&応用&リファレンスなら「JavaScriptist」

  

ReflectionClass::getMethod

(PHP 5, PHP 7)

ReflectionClass::getMethodクラスメソッドの ReflectionMethod を取得する

説明

public ReflectionMethod ReflectionClass::getMethod ( string $name )

クラスメソッドに関する ReflectionMethod を取得します。

パラメータ

name

調べたいメソッドの名前。

返り値

ReflectionMethod を返します。

エラー / 例外

メソッドが存在しない場合に ReflectionException が発生します。

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

参考


忘却曲線を使ってこの知識を確実に記憶に残す

フォーラムで「ReflectionClass::getMethod - クラスメソッドの ReflectionMethod を取得する」について話す
各種マニュアル: PHPマニュアル | PEARマニュアル | Smarty(英語)マニュアル | PHP-GTKマニュアル | ReflectionClass::getMethod - クラスメソッドの ReflectionMethod を取得する」をGoogle検索
copyright © 1997-2024 PHP ドキュメント作成グループ(ライセンス). provided by php spot. マニュアル: