|
ReflectionClass::getMethodsGets an array of methods Beschreibung
public array ReflectionClass::getMethods
([ int
$filter
] )Gets an array of methods for the class. Parameter-Liste
RückgabewerteAn array of ReflectionMethod objects reflecting each method. Beispiele
Beispiel #1 Basic usage of ReflectionClass::getMethods
<?phpDas oben gezeigte Beispiel erzeugt folgende Ausgabe:
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"
}
}
Beispiel #2 Filtering results from ReflectionClass::getMethods
<?phpDas oben gezeigte Beispiel erzeugt folgende Ausgabe:
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"
}
}
Siehe auch
|