| ユーザフォーラムで議論/質問 | マニュアル検索 | ハイライト | ハイライトオフ | ポータル | php spot |
ReflectionClass::getMethods(PHP 5, PHP 7) ReflectionClass::getMethods — メソッドの配列を取得する 説明
public array ReflectionClass::getMethods
([ int
$filter
] )クラスのメソッドの配列を取得します。 パラメータ
返り値各メソッドを表す ReflectionMethod オブジェクトの配列を返します。 例
例1 ReflectionClass::getMethods() の基本的な使用例
<?php 上の例の出力は以下となります。 array(3) { [0]=> &object(ReflectionMethod)#2 (2) { ["name"]=> string(11) "firstMethod" ["class"]=> string(5) "Apple" } [1]=> &object(ReflectionMethod)#3 (2) { ["name"]=> string(12) "secondMethod" ["class"]=> string(5) "Apple" } [2]=> &object(ReflectionMethod)#4 (2) { ["name"]=> string(11) "thirdMethod" ["class"]=> string(5) "Apple" } }
例2 ReflectionClass::getMethods() のフィルタリング
<?php 上の例の出力は以下となります。 array(2) { [0]=> &object(ReflectionMethod)#2 (2) { ["name"]=> string(12) "secondMethod" ["class"]=> string(5) "Apple" } [1]=> &object(ReflectionMethod)#3 (2) { ["name"]=> string(11) "thirdMethod" ["class"]=> string(5) "Apple" } } 参考
|
各種マニュアル:
PHPマニュアル |
PEARマニュアル |
Smarty(英語)マニュアル |
PHP-GTKマニュアル |
「ReflectionClass::getMethods - メソッドの配列を取得する」をGoogle検索
|