PhpStorm 2018.1 Help

PHP

File | Settings | Languages and Frameworks | PHP for Windows and Linux
PhpStorm | Preferences | Languages and Frameworks | PHP for macOS
Ctrl+Alt+S
settings


The page and all the pages under this node are available only when the PHP plugin is enabled. The plugin is activated by default. If the plugin is disabled, enable it on the Plugins settings page as described in Enabling and Disabling Plugins.

Use this page to configure PHP development and unit testing support in the project by choosing one of the available PHP interpreters, see Configuring Local PHP Interpreters and Configuring Remote PHP Interpreters.

ItemTooltip and
Shortcut
Description
PHP language level In this drop-down list, specify the PHP functionality scope to get coding assistance for. Each functionality scope is associated with the PHP version that supports this functionality. Currently PHP 5.3, PHP 5.4, PHP 5.5, PHP 5.6, PHP 7, PHP 7.1, and PHP 7.2 levels are supported.

No correlation between the PHP version used in the project and the language level is enforced. Although the language version of each interpreter is detected automatically, you can still tell PhpStorm to provide you with coding assistance that corresponds to a different language level. However, if you attempt to use a code construct that is not supported by the specified language level, PhpStorm suggests a Switch to PHP <version> quick-fix.

CLI Interpreter From this drop-down list, choose the PHP interpreter to use in the current project by default. The list contains all the currently configured local and remote PHP interpreters. See Configuring Local PHP Interpreters and Configuring Remote PHP Interpreters for details.
browseButton.png Shift+Enter Click this button next to the CLI Interpreter list to create a new PhpStorm-wide PHP installation configuration in the CLI Interpreters dialog box, that opens.

See Configuring Local PHP Interpreters and Configuring Remote PHP Interpreters for details.

Include Path Tab

The area displays the list of configured include paths. Include paths are used for holding third-party code that is used for completion and reference resolution in some functions/methods that use file paths as arguments, for example, require() or include().

  • Use Add and Remove to add and remove paths.
  • Use Move up and Move down to reorder the items in the list.
  • Click Sort to have the paths sorted alphabetically in the ascending order.

PHP Runtime Tab

The area lists the available PHP stubs, which are normal, syntactically correct PHP files containing annotated function, method, and class signatures, constant definitions, etc. PHP stubs are added to PhpStorm's internal knowledge to enhance coding assistance for all the Standard PHP Library components as well as for common extensions.

  • Use the checkboxes next to each item to enable/disable the corresponding stub.
  • To load the set of stubs that matches the set of loaded extensions for the currently configured CLI interpreter, click the Sync Extensions with Interpreter button. For details on configuring interpreters, see Configuring Local PHP Interpreters and Configuring Remote PHP Interpreters.

In the Project Tool Window, the currently loaded stubs are displayed under the External Libraries node.

Advanced Settings Area

If necessary, you can load a set of custom PHP stubs to be used by PhpStorm. Click browseButton next to the Default stubs path field and provide the stubs folder location in the dialog that opens. This way, you can load additional stubs as well as override the bundled ones.

Analysis Tab

Use this tab to configure the exception analysis performed by PhpStorm, which alters the behavior of the Unhandled exception, Redundant catch clause, Missing @throws tag(s), and Redundant @throws tag(s) inspections.

ItemTooltip and
Shortcut
Description
Call tree analysis depth

Use this list to set the desired analysis depth level. By default, 1 is selected, in which case PhpStorm reports the unhandled exceptions for the parent method throwing an exception, as well as the methods directly calling it. Selecting larger values allows you to drill down deeper into the calls hierarchy.

If 0 is selected, the exception analysis is limited to the parent method.

Unchecked Exceptions Use this list to specify the exceptions that are treated as unchecked by PhpStorm. Such exceptions are skipped during exception analysis.
add-class Alt+Insert Click this button to add a class to the Unchecked Exceptions list. In the Choose Class dialog that opens, locate the desired class by using the Search by Name tab or the Project tab.
remove black Delete Click this button to remove a selected class from the Unchecked Exceptions list.
Last modified: 1 June 2018

See Also