Is there a tool that helps to track all potential use of, say, a specified variable? At the moment I need this for PHP but would like also to know if there are (better) tools for other languages instead.
I've found http://phpcallgraph.sourceforge.net/ that would offer some help, but it seems it graphs function tree, including functions that most certainly does not use the data I want to follow. An option to filter out all those "unrelated" functions from the function call tree apparently is what I'm looking for. Also, I need to see all the called functions for each caller function in turn (only if the particular variable/value is being passed).
The need is to see, when changing existing, not too well organised code — all the possible uses of values (e.i. data dependencies) of a specific DB field to understand what impact and where its changes may have on the code and modify it accordingly if needed.