In this video, Susi Moog, TYPO3 developer, shares her tips on how to debug efficiently based on her years of coding experience.
Debugging is a process to methodically identify, isolate, and correct bugs in programs. Even if you’re not squashing bugs, you need debugging tools to be creative at any point of development. What variables are in scope? What happens when this code is executed? That is what debugging can help you answer.
While developers often use PHP functions like var_dump, echo and print_r to output the variables onto the screen, or identify control flows as they happen, there are better ways of doing it. Those techniques are easy to do and don’t need much set up, but the resulting output is difficult to use. Using the Xdebug PHP extension to debug your applications is not only faster, it’s also more efficient and gives you a deeper insight into the control flows of your application.
Come along and watch Susi demonstrate how easy it is to set up debugging with PHPstorm and Xdebug.
Where to get Xdebug for your PHP version
How to set up the Chrome extension Xdebug helper for one-click debugging
How to set up PHPStorm for debugging and validating settings
How to configure custom ports for debugging
How to add breakpoints
How to step through the source code with the debugger
Knowing all this will make your debugging process faster and more efficient!
You'll find answers to other frequently asked technical questions, instructional clips and all sorts of helpful videos on our TYPO3 YouTube channel. Come along and join us there. If you find this useful, please share the link on your network.