Is it possible to set a "PHP Exception Breakpoint" inside of PhpStorm debugger so that it triggers each time a specific variable is used?
For example I have a $_GET['foo']
in request and want debugger to pause every time the variable $_GET['foo']
is used in code.
Exception breakpoints only trigger when an error has occurred, so the short answer is "no."
However, you can right-click (or control+click, for Mac) the top folder in your source tree in the project file browser and choose "Find in Path" to locate all instances of $_GET['foo']
. Once you know where they all are, create normal breakpoints in the usual way. Then put them into a "group," according to your intentions for those breakpoints:
$_GET['foo']
is referenced, using the "Find in Path..." feature of the project file browser to search for them globally (Find the main folder of your project; then Right-click for PC or [Control]+[Click] for Mac to find this option).$_GET['foo']
, click Run > View Breakpoints to show them in a list.In the View Breakpoints screen, you can then enable or disable the entire breakpoint group by checking its box. When that group and its breakpoints are no longer needed, you can delete a group by clicking the [-] minus button.