PHP Editor allows you to collapse the content of functions, classes, namespaces and PHPDoc to have a better overview of your code.

PHP code outlining

Default Shortcuts

  • Ctrl+M, O - Collapse all blocks to definitions.
  • Ctrl+M, P - Stop outlining.
  • Ctrl+M, M - Toggle outlining.
  • Ctrl+M, L - Toggle all outlining.

Collapsible Regions

The following list describes all the code fragments supporting outlining:

  • Class body
  • Namespace content
  • Function body
  • Lambda functions
  • PHPDoc comment block
  • Multi-line comments
  • Group of single-line comments
  • PHP script tags containing more than one line of code
  • PHP content between #region/#endregion or //region///endregion
  • Code blocks enclosed in { ... } (since version 1.18)
  • Content of switch, case and default (since version 1.18)
  • Code enclosed within for, foreach, if, else, elseif (since version 1.18)

Outlining behavior can be modified in PHP language options. To disable automatic outlining of a newly opened file, or to change additional outlining options, go to Tools | Options | Text Editor | PHP | Advanced.

Outlining Code Blocks

Outlining code blocks has to be enabled in Tools | Options, under Text Editor > PHP > Advanced.

#region Outlining

Outlining of #region sections

Single line comments starting with the region keyword are treated as the start of collapsible region, and are matched with a following endregion comment. Regions can be nested. Alternately, the user can specify the region name after the region keyword.