Problems and Code validation

The entire workspace is continuously analyzed for potential issues and problems. They are all listed in the VSCode's Problems window where the user can filter and navigate to certain issues.

Problems Window


Most flexible way of configuring diagnostics; edit or create .editorconfig file within the project directory. The file can be nested in a sub-directory as well. For more information, see

To configure a diagnostic, add section matching the file path and file name applying to, by default it would be [*.php].

php_diagnostic_php6401 = false
php_diagnostic = true

Add rules, according to the problem error code.

Rule format

Rules are in format php_diagnostic_php[error_code] = [value] (lower cased). Possible values are:

  • true, on: the diagnostic will be listed with its default severity.
  • false, silent, off, none: the diagnostic won't be listed.
  • fatalerror: the diagnostic will be listed as fatal error.
  • error: the diagnostic will be listed as error.
  • warning: the diagnostic will be listed as a warning.
  • message, suggestion: the diagnostic will be listed as a message.
php_diagnostic_php6401 = message
php_diagnostic_php6402 = false

For all the diagnostics with any error code, use rule in format php_diagnostic = [value].

php_diagnostic = error

Note, rule with the error code (php_diagnostic_php[error_code]) has a precedence over the rule without the error code (php_diagnostic).


Problems can be disabled in VSCode's settings.json file.


By default, PHP Tools scans continuously the entire workspace for possible issues and problems, excluding the vendor folder. This behavior can be changed to either analyse everything (option "all"), only user files excluding the vendor (option "user"), or nothing (option "none").


  • "php.problems.scope": "none": No problems analysis is performed. Note, this also disables unused use check, unreachable code checks, and others.
  • "php.problems.scope": "user": (default) Problems are checked in the workspace files excluding /vendor/** and other framework-specific directories (such as /wp-includes/ in WordPress, etc.).
  • "php.problems.scope": "all": Enables problems analysis across the entire workspace.


"php.problems.scope" : "none"

Although, in case the file is opened in editor for editing, it gets analysed always.


The setting allows to exclude problems found in specified files or entire directories from being shown in Problems panel. There are two possible values:

"php.problems.exclude" : {
    'path' : true,
    'path' : [1111, 2222],
  • Boolean value true marks the files or directories matching given glob pattern path to be excluded in problems panel.
  • Array value [] may contain only specific problem codes to be excluded within files matching the glob pattern path.

Any rules matching the same folder are merged, as depicted on the sample below. The sample disables all warnings in 'vendor' directory and disables additionaly one warning PHP0406 in the entire project.

"php.problems.exclude" : {
    "/" : [406],
    "vendor/" : true,

@suppress PHPDoc tag

Problems can be suppressed for a specified function or a class only. Following PHPDoc tags allows to suppress warnings in the associated function block or class block: @suppresswarnings, @suppress, or @suppresswarning.


 * @suppress PHP6401
function foo() {
    // something with error 6401, won't be reported

Suppressed error codes can be optionally separated by a comma or a space.

Related links