r/PHP • u/barel-barelon • 3d ago
News PHP Debugger - Agentic zero-overhead debugging
Hi, I wanted to introduce PHP debugger, a tool I built together with Roman Pronskiy, former Executive Director of The PHP Foundation and former head of PhpStorm at Jetbrains.
We took Xdebug and removed everything that was not related to debugging and optimised to death the case where the debugger was enabled but not connected, and were able to achieve near zero-overhead.
This means that instead of having to enable and disable or trigger the debugger all the time, you can leave it permanently on, ready to start a debugging session when you need it and out of the way when you don't.
And this has also allowed us to build an MCP server that connects to the debugger and which can be used by agents to debug PHP code in the same way that humans do, setting breakpoints, reading values and stepping through the code.
This raises the possibilities of agentic debugging to a new level and allows your agents to fix issues with precision and without any wild guesses.
PHP debugger is really easy to install, so why don't you give it a go and let us know what you think? https://github.com/php-debugger/php-debugger
7
u/ArdorWaheguru 3d ago
Giving an agent actual runtime state via step debugging instead of letting it guess from stack traces makes a lot of sense. What stops the agent from getting stuck on a breakpoint and hanging the worker pool if a condition isnt met?
3
u/rock217 3d ago
No profiling or tracing is a little rough.
10
u/thomasmoors 3d ago
Nice work. Maybe you want to consider a more googleble name?
1
u/titpetric 3d ago
Is there a spec for the protocol that remains, to know what is or isn't implemented? I may have a case where I could provide a debugger interface, does this make is easier or more focused to write the server instrumentation? I vaguely know that xdebug has some coverage instrumentation, what exactly was stripped away?
-2
u/Crell 3d ago
Oh good. Slopping someone else's work, and someone who is very outspoken about not liking slop.
Remind me to never use this.
-1
u/mYkon123 3d ago
That sounds awesome - I'll test
-3
u/roxblnfk 3d ago
Oh, we also built an MCP server and a set of skills for Buggregator Trap and Server, allowing agents to use xDebug during the debugging process. Furthermore, it includes support for profilers, var-dumps, logs, email, Sentry, telemetry, and much more.
Now I’ll add a skill for the PHP Debugger, so that your tool can be used more extensively.