Postfix Code Completion for PHP in PhpStorm 9 EAP

PhpStorm 9 brings postfix code completion for PHP, earlier introduced for Java in IntelliJ IDEA and for JavaScript in WebStorm. This new kind of code completion can help raise your productivity even more.

Postfix code completion helps reduce backward caret jumps as you write code. It lets you transform an already typed expression to another one based on the postfix you’ve added, the type of expression, and its context.

For example, when you apply the .if postfix to an expression (just press Tab), it will wrap it with an if statement. Here’s how it looks in action:


Postfix completion suggestions are shown as part of basic completion. If you’d like to see the whole list of postfix completions applicable in the context, press the Ctrl+J (CmdJ).


All postfix completion templates can be found in Settings / Preferences | Editor | General | Postfix Completion, where you can explore them and disable any that you don’t need:


Some of the templates have aliases (alternative postfix names). For instance, the exclamation mark will have the same effect as .not. Just enter ! after an expression and press Tab to negate it.

If there are multiple options of how a postfix template can be applied, the IDE will ask which expression you meant:


Download the latest PhpStorm 9 EAP and try postfix code completion for PHP today!

Please share your thoughts, feature requests or encountered issues through the issue tracker, by posting in the comments below, or in our forums.

Develop with pleasure!
-JetBrains PhpStorm Team

This entry was posted in Cool Feature, Early Access Program and tagged , , , . Bookmark the permalink.
  • Ravan Scafi

    It will be possible to create our own postfix templates in the future?

  • Jay

    Why do we even have to type this stupid $this? Why can’t PHPStorm just figure it out when typing getName()? This is really my pet peeve, as it’s been a feature of other IDE-s for at least 10 years.

  • Frank