DEV Community

Discussion on: Turbocharged PHP Development with Xdebug, Docker & PHPStorm.

Collapse
 
marcusatlocalhost profile image
Marcus

I really like Xdebug to learn about the programming flow, but often it's easier and more enlightening to throw in a ddd($object, $arr) provided by Kint Debugger to inspect methods of an object and so on. It's awesome!

Anyways - I'm kind of interested in using Docker, but I fear my current workflow (all projects crammed in a single Xampp instance, separated by subdomains (local.projectdomain.com)) doesn't work with Docker anymore.
Right now they are always available and I can easily switch between all of them.
The downside is, I haven't found (or better tried) a way to use different PHP versions yet.

I can see what speaks for using Docker, but I'm not sure if I want to add more complexity. Any Thoughts?

Collapse
 
secondej profile image
James Seconde

XDebug does all the things that Kint does, with the difference being that you can modify the runtime without killing the PHP-fpm thread by doing a dd() - it's one of the things that makes it super powerful. As you can evaluate with your IDE at the time of pausing, if you want you can go through the stack and look at every single method call, including vendor ones.

Docker takes a heavy investment to get right, there's no doubt about it. But once you do, you're abstracting away your application's dependencies, and that is a big time win.

Collapse
 
secondej profile image
James Seconde

It's probably also worth noting that XDebug has enhanced var_dump() capabilities

Collapse
 
stephenpienaar profile image
Stephen Pienaar

And I count XDebug as one of my best friends ;)

Marcus, like you I am heavily invested in the Xampp echo system. My preferred variant is WampServer. It offers one the option to easily switch between PHP versions.

Thank you for this write-up James. I have been delaying the switch to Docker for the reason of the perceived (or real?) complexities. I now feel more ready to take the plunge!