If you're using Xdebug for PHP debugging, there's a new version that just released today: Xdebug 3. Check out the announcement! Promising massive performance boosts, a simpler configuration paradigm, and support for the upcoming (tomorrow!) PHP 8.0 release.
James SansburyJust launched! Massive increase in performance of your local #php debugging by upgrading to Xdebug 3. This also means PHP 8 support! If you're upgrading, check out the Upgrade guide: xdebug.org/docs/upgrade_g… twitter.com/derickr/status…15:31 PM - 25 Nov 2020Derick Rethans @derickr🎉 Xdebug 3 is released! → https://t.co/6gucNuKs7h https://t.co/R6GjxQIyso
To read about how to upgrade from Xdebug 2 to Xdebug 3, read the upgrade guide. Some highlights below:
The benchmarks of Xdebug 3 have shown that Xdebug 3 is 34% faster for step debugging, and 25% faster when in
develop mode. In addition, if you have the Xdebug extension installed, but aren't actively using it (features are disabled), Xdebug 3 is over 99% faster than Xdebug 2.
One of the big shifts with Xdebug 3 is the introduction of the
xdebug.mode ini setting. If you've ever struggled getting just the correct incantation or flavor of Xdebug ini settings to get debugging working, feast your eyes on this thing of beauty:
That's it. No more deciphering if you need
profiler_enable on, or trying to remember what exactly
You can combine Xdebug modes together with a comma. These other modes for
offEverything is—ahem—off. This means you can have the extension installed but disabled, and a negligible performance hit. ✨ I'm guessing you can't really combine this with the other modes? 🤷♂️
developTurns on development aids. If you like stack traces or if
var_dump()is your friend, you'll want this setting.
coverageIf you're running code coverage reports with PHPUnit, turn this on.
debugEnables step debugging. 😋
gcstatsCollect statistics about PHP's garbage collection mechanism. 🗑
profileUse this to analyze performance with tools like KCacheGrind.
traceEnables the Function Trace feature, which allows you record every function call, including arguments, variable assignment, and return value that is made during a request to a file.
Time will tell, but I'm guessing
xdebug.mode on most of my projects will be:
XDEBUG_CONFIG="idekey=wtf" days? No longer. Now it's simplified to an
XDEBUG_SESSION environment variable to turn on step debugging. Set this environment variable to the key you'd like for that step debug session.
⚠️ Heads up: the default step debugging port has changed from port 9000 to port 9003.
What's not to love about this release? I'm excited to be able to have the extension installed and available without a huge performance hit. I'm looking forward to simpler configuration. And tomorrow, PHP 8.0 will land, which is the first release to have JIT compiling.