PHP call graph utility?

Not sure there exists anything that can analyse source-code written in PHP to generate that... But there is a possiblity, when you are running the code.

You might want to take a look at the Xdebug extension : it brings profiling to PHP, and and generate callgrind-like files, that can be read with KCacheGrind on Linux.

And this one is able to generate some kind of callgraphs.


It can also be integrated with PHPUNit, to generate code-coverage when running unit-tests
Some time ago, PHPUnit was able to generate some callgraphs with graphviz ; I don't find that option anymore, though :-(


EDIT : it's the first time I hear about it, but there is a project called phpCallGraph that might be able to help you, too... and it seems there is work going on, if I look at it's changelog


I would definitely try Doxygen. It has support for PHP, and the call graphs and caller graphs it creates have been very useful in exploring "foreign code" for me previously.

Example of doxygen call graph