Code Completion#
The PHP editor analyses the entire workspace, it determines expressions type, function return type, property type, and local variables type. The inferred type information can be improved by providing further details using PHPDoc comments (see below).

Code completion is context-aware, scope-aware, type-aware, with the respect to conventions and additional heuristics.
Supported Notations#
The following notations are supported:
- PHPDoc type annotations.
- PHPDoc generic type annotations, including nested and conditional declarations.
- Majority of PhpStan annotations in PHPDoc, templates, type aliases, generics, conditional return, type substitutions, and more.
phpstan.neon,phpstan.neon.dist,phpstan.dist.neonfiles withtypeAliasessection.- Majority of Psalm type annotations in PHPDoc.
phpcscomments for disabling and enabling errors, i.e.// phpcs:disableand// phpcs:ignorefile@mixinPHPDoc annotation.- JetBrains's PhpStorm
.phpstorm.meta.phpfile with additional annotations.- limitations: #2265 - file is analyzed statically so variables and dynamic values are ignored.
- Symfony and Laravel features (IntelliSense):
- deducing defined class aliases
- deducing provided services and facades
- Eloquent local scopes and extension methods
- See Laravel Framework for more.
- CodeIgniter3 and other frameworks.
Completing Parentheses#
By default, completing a function name also completes parentheses and, if the function has any parameters to fill in, the keyboard cursor is placed inside them.
This behavior is controlled by the setting:
Alternativelly, the editor may complete default values for all the parameters. Set the setting to "parameters" to do so:

Automatic Triggers#
The completion can be triggered manually (Ctrl+Space by default) or automatically. The automatic triggers are:
- a letter completes available symbols in the current context
::after a class/interface/trait name completes the type static members and constants.->after an object instance completes the object's non-static members.\as a part of a qualified name completes the namespaced (qualified) type name.$as a first letter shows variables in the current function scope.- a letter or
Ctrl+Spaceafternewkeyword completes possible class names - a letter or
Ctrl+Spaceafterthrow newcompletes only throwable classes - a letter or
Ctrl+Spaceafterusekeyword. /**above a declaration completes a PHPDoc comment block. See PHPDoc Generator for more details.
Additional Information#
The editor provides an option to show additional information about the symbol in the code completion list. The information contains the symbol's description as it is written in the corresponding PHPDoc or PHP manual. Additional information may include:
- URL to the corresponding PHP manual Web Site.
- a return value description.
- a Laravel facade accessor.
- a compatibility status, such as a deprecation.
Optimizing Completion#
In case variable's or function's type information cannot be inherited, it is advised to provide the expected type in form of a PHPDoc comment. The type hinting works for functions, properties and variables.
An example of type hinting: