Its important for programmers to be able to quickly identify all usage of a function. Knowing where and how a function is called helps greatly in understanding the intent of the code and allows the programmer to refactor with confidence.
There aren’t any tools for PHP that identify function usage, the way one might do with Java using Eclipse. The recent release of Zend 6 for Eclipse comes closer with its refactor feature, but only refactors within a single file and not across a project.
I solve this need with a handy grep call. The following grep finds all usage and definitions of a PHP function, and omits results from .svn directories. Just replace FUNC_NAME with the name of the function you’re investigating.
