Home » Php » php – How to turn off warnings while debugging in VS Code?

php – How to turn off warnings while debugging in VS Code?

Posted by: admin July 12, 2020 Leave a comment

Questions:

I’m debugging a PHP app in VS Code using XDebug(PHP Debug extension) and getting errors like:

VS Code PHP debugging error

I understand what the problem is and how to fix it, but the solution is so huge, that fixing such an errors is something I can’t do at the moment.

I want to start using VS Code for PHP development. I was using Visual Studio with “PHP Tools for Visual Studio” and didn’t have this problem.

In the first script which is loaded when the request occurs, I have error_reporting(E_ALL^E_WARNING^E_NOTICE);, which should suppress such an errors. But it seems that the VS Code debugger ignores it. I didn’t find any setting for PHP Debug which could help me with this.

Is there any way how to tell VS Code Debugger to ignore/not display such errors?

How to&Answers:

It is possible to set where debugger stops in “Debug / Breakpoints” panel or VS Code:

enter image description here