note 107268 added to book.reflection
| From: | sreeekanth at outsource-online dot net | Date: | Thu, 26 Jan 2012 10:55:21 +0000 |
| Subject: | note 107268 added to book.reflection | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-185749@lists.php.net to get a copy of this message | ||
I wanted to know in which superclass(and its location) did a particular method was first declared
the snippet below helped
$className = 'classname';
$method = 'methodname';
while(in_array($method,get_class_methods($className)))
{
$rf = new ReflectionClass($className);
echo $className." : ".$rf->getFileName()."<br />";
$className = get_parent_class($className);
echo "parent: ".$className."<hr />";
}
----
Server IP: 69.147.83.197
Probable Submitter: 122.167.201.55
----
Manual Page -- http://www.php.net/manual/en/book.reflection.php
Edit -- https://master.php.net/note/edit/107268
Del: integrated -- https://master.php.net/note/delete/107268/integrated
Del: useless -- https://master.php.net/note/delete/107268/useless
Del: bad code -- https://master.php.net/note/delete/107268/bad+code
Del: spam -- https://master.php.net/note/delete/107268/spam
Del: non-english -- https://master.php.net/note/delete/107268/non-english
Del: in docs -- https://master.php.net/note/delete/107268/in+docs
Del: other reasons-- https://master.php.net/note/delete/107268
Reject -- https://master.php.net/note/reject/107268
Search -- https://master.php.net/manage/user-notes.php