2

Do any of the well-known PHP debuggers offer any method of logging stack traversal? Say I wanted to somehow store a log of every entry/exit of every class, class method, and function.

Is there any way to do this all on the server side (maybe some sort of plaintext client that could log every step-in/step-out automatically)?

Update: It looks like I would be looking for some sort of PHP-based DBGP client if working with Xdebug. The only thing I've found so far is a CLI client that I can access indirectly with PHP (assuming the PHP runtime user has access): http://candyscript.com/projects/dbgp/

Wilco
  • 32,754
  • 49
  • 128
  • 160

2 Answers2

3

I think what you're after can be achieved using XDebug in conjunction with KCachegrind(Linux/Unix) or WinCachegrind(Windows).

I might have misunderstood your question, but to get a glimpse of what KCachegrind can do for you have a look at this: alt text
(source: sourceforge.net)

On the right you can see the call graph.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
André Hoffmann
  • 3,505
  • 1
  • 25
  • 39
1

Try xhprof, available on PECL, it may do what you need.

StasM
  • 10,593
  • 6
  • 56
  • 103