From time to time, I’m handed bloated, undocumented, buggy PHP code to fix. I have several tools I use to fix such code as quickly as possible.
One thing I’m not sure how to do that occasionally causes me grief is finding where a function is located (in which file it is defined). Note that I don’t want to know where a function is called from.
For example I’d like to be able to do this:
//file1.php
function foo(){
echo 'bar';
}
.
//file2.php
where_is_function('foo');//error
include('file1.php');
echo where_is_function('foo');//outputs'file1.php'
Get yourself a good IDE such as netbeans or eclipse. They have functionality to find function declarations, and also find the usages of those functions (under refactoring).
Personally I use netbeans. I simply have to
ctrl-clickon a function name & netbeans will find where the function is defined, and automatically open the file for me.