note 115197 added to reflectionclass.getmethods
| From: | tom at r dot je | Date: | Wed, 11 Jun 2014 17:40:09 +0000 |
| Subject: | note 115197 added to reflectionclass.getmethods | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-199655@lists.php.net to get a copy of this message | ||
ReflectionClass::getMethods() sorts the methods by class (lowest in the inheritance tree first) then
by the order they are defined in the class definition:
<?php
class A {
public function method1() {
}
public function method2() {
}
}
class B extends A {
public function method3() {
}
public function method4() {
}
}
$class = new ReflectionClass('B');
print_r($class->getMethods());
?>
This will output:
Array
(
[0] => ReflectionMethod Object
(
[name] => method3
[class] => B
)
[1] => ReflectionMethod Object
(
[name] => method4
[class] => B
)
[2] => ReflectionMethod Object
(
[name] => method1
[class] => A
)
[3] => ReflectionMethod Object
(
[name] => method2
[class] => A
)
)
----
Server IP: 72.52.91.14
Probable Submitter: 94.4.9.139
----
Manual Page -- http://php.net/manual/en/reflectionclass.getmethods.php
Edit -- https://master.php.net/note/edit/115197
Del: integrated -- https://master.php.net/note/delete/115197/integrated
Del: useless -- https://master.php.net/note/delete/115197/useless
Del: bad code -- https://master.php.net/note/delete/115197/bad+code
Del: spam -- https://master.php.net/note/delete/115197/spam
Del: non-english -- https://master.php.net/note/delete/115197/non-english
Del: in docs -- https://master.php.net/note/delete/115197/in+docs
Del: other reasons-- https://master.php.net/note/delete/115197
Reject -- https://master.php.net/note/reject/115197
Search -- https://master.php.net/manage/user-notes.php