Site Builder Studio

SITEBUILDERSTUDIO

Using XDebug with PHPStrorm

Debugging with var_dump ( or dd in laravel ) can get us what we need to know most of the time, however it means we need to edit the files ( which can cause unneeded version updates in VCS repositories ) and is often like chasing a worm through the soil, it just gets a bit messy. XDebug provides a very useful tool window in PHPStorm that shows us what ALL variables are set to, can show the method call stack ( list of all files and functions called before a certain point ), and can also help us hunt down code that should be optimized.

In a quest to learn XDebug with PHPStorm there’s quite a few tutorials on how to install, but finding clear teaching on how to use is a bit harder. Here’s some of the best resources I found for how to use XDebug with PHPStorm.

12 min vid quick intro

52 min vid deeper dive

Free course on XDebug

58 min vid on debugging in PHPStorm, from JetBrains