What’s New in PhpStorm 2023.3

The highlights of this major update include:

  • AI Assistant is out of preview
  • Pest support
  • PHP 8.3 support
  • Improved Symfony support
  • Quality-of-life improvements to the UI

AI Assistant is out of preview General Availability

JetBrains AI Assistant is now generally available with a number of new and improved features to increase your productivity in JetBrains IDEs.

LLM-based code completion

LLM-based code completion

AI Assistant can now generate multi-line blocks of code for you. Simply start typing on a new line, and if an LLM suggestion is available, a grayed-out code snippet will appear. Press Tab to accept the suggestion.

Currently, such suggestions are available within class contexts or inside function definitions.

Test-code generation

Test-code generation

AI Assistant can also generate tests for class methods. With the caret placed on the class method you wish to cover with unit tests, just press Alt+Enter, select AI Assistant, and choose Generate Unit Tests.

In-editor code generation

In-editor code generation

Previously, you could use AI chat to generate code snippets. Now there is an AI Assistant | Generate code… action that opens a prompt right inside the editor. You will be asked to enter a description of the code you wish to generate. Once you do, AI Assistant will provide suggestions, and you can accept part or all of them.

AI-based error explanations in the console

AI-based error explanations in the console

Sometimes, when you execute a PHP script or run configuration, or run a Composer action, the job fails for some reason. AI Assistant can help you determine the root cause of the issue. Click the Explain with AI button in a stack trace or error message to get an AI-generated explanation.

Use AI Assistant in PhpStorm as a supplemental feature with a JetBrains AI Service subscription.

Pest updates

PhpStorm now supports the Pest test framework out of the box. We recently agreed with the original author of the Pest plugin to take over its development and bundle it in PhpStorm. You can read the details in our recent blog post.

Pest tests

Just like PHPUnit tests, Pest tests can now be run directly from PhpStorm. When you place your caret inside a test and trigger the run window, a run configuration will be created for that specific test. You can place the caret in the file but not inside any particular test to trigger all the tests in that file.

Assertions

With this new Pest support, you can write assertions by calling functions or methods on $this. It also improves autocompletion in test functions, so you can see what assertions are available as you type.

Custom expectations

In Pest, you can write custom expectations to reduce boilerplate checks in your tests. PhpStorm can help you find usages of custom expectations and help you rename them.

PHP 8.3 support

PhpStorm 2023.3 comes with full support for PHP 8.3. Most of the changes in the IDE will be integrated organically into your PhpStorm workflow without you even noticing them, so we’ll only mention the new features you'll need to know about in order to benefit from them.

Override attribute

#[\Override] attribute

PHP 8.3 introduces the new #[\Override] attribute. It can be used to explicitly show your intent when overriding a method. The PHP engine is able to check whether a method marked with #[\Override] actually overrides the parent method, throwing an exception if this is not the case. PhpStorm 2023.3 gives you a warning about such cases in advance.

Adding Override attribute suggestion

PhpStorm also suggests adding the #[\Override] attribute when applicable.

json_validate() function json_validate() function

New json_validate() function

PHP 8.3 adds the new json_validate() function to the standard library. Previously, the only way to validate whether a string was valid JSON was to decode it and detect whether any errors were thrown. PhpStorm can detect these patterns and suggest replacing them with a json_validate() function call. This can be beneficial if you only need to know whether the input is valid JSON, since it uses less memory compared to decoding the string.

Typed class constants

Typed class constants

In PHP 8.3, you can declare types for class constants. All type declarations can be used except for void, callable, and never.

For typed class constants, PhpStorm provides:

  • Suggestions to insert the appropriate types
  • Type hint completion
  • Compatibility checks with the default value’s type
  • Type redeclaration checks when overriding a constant in a child class
Deprecations Deprecations

Deprecations

PHP 8.3 introduces a few deprecations, and PhpStorm has you covered with corresponding inspections to spot them.

Symfony support

PhpStorm 2023.3 brings various improvements for Symfony developers.

New Project wizard

New Project wizard

A new built-in project initializer for Symfony allows you to create new Symfony projects with the desired types and versions right from the Welcome screen.

Doctrine Query Language support in QueryBuilder

Doctrine Query Language support in QueryBuilder

You can now enjoy full IDE support for DQL inside QueryBuilder method calls. Features include highlighting, field completion, the ability to resolve to the target model class, and more.

Conversion of annotations to attributes for Symfony and Doctrine

Conversion of annotations to attributes for Symfony and Doctrine

Following the introduction of attributes in PHP 8.0, Doctrine annotations are being deprecated and will soon be removed. In order to help you make the switch, PhpStorm 2023.3 includes functionality for converting Doctrine annotations to attributes.

PhpStorm also supports the conversion of Symfony annotations to their corresponding attributes, like #[Required], #[Route], and so on.

Other updates for PHP

Option to exclude external library files from your project

Option to exclude external library files from your project

As an experimental new feature, we’ve also added the ability to exclude directories that come from indexed libraries. Excluding such files from your project will help you avoid multiple-definition problems and improve indexing performance.

Dedicated styling of generic types

Dedicated styling of generic types

We continue to work on improving the experience of using generics. In PhpStorm 2023.3, it is now possible to set up color-coding for generics, making it easier to distinguish between generic types.

Ability to fold multiline PHP attributes

Ability to fold multiline PHP attributes

With the adoption of attributes increasing, it can sometimes be hard to read code that is annotated with long multiline attributes from a given framework. In PhpStorm 2023.3, this should no longer be an issue, since you can now fold multiline attributes.

PHPUnit metadata conversion from PHPDoc to attributes

PHPUnit metadata conversion from PHPDoc to attributes

PHPUnit 10 introduced support for attributes for adding metadata to test classes and test methods, as well as tested code units. We’ve implemented an inspection and a quick-fix that will help you migrate to this new style from the old PHPDoc annotations.

Version control systems

The all-in-one diff viewer

PhpStorm 2023.3 introduces a revamped way to review changes. Now, instead of going through each file one by one, you can see all of the modified files from a changeset in a single, scrollable frame. This new diff viewer is accessible from the Git Log tool window and currently works with JetBrains Space reviews. We’re working on making it compatible with GitLab and GitHub.

Debugger

Debugger

PhpStorm 2023.3’s new Run to Cursor inlay option allows you to quickly execute up to a specific line of code while debugging. Once your program is suspended, you can hover over the line of code you want to execute up to and use the Run to Cursor popup. The same can be achieved by invoking the keyboard shortcut Alt + F9 after placing the caret on the desired line.

User interface

Option to hide the main toolbar in the default viewing mode

Option to hide the main toolbar in the default viewing mode

In response to your feedback about the new UI, we’ve made it possible to hide the main toolbar when using the IDE’s default viewing mode, just like in the old UI. To remove the toolbar, select View | Appearance and uncheck the Toolbar option.

Option to revert to the default tool window layout

Option to revert to the default tool window layout

With the release of PhpStorm 2023.1, we introduced the ability to save multiple tool window layouts and switch between them, enhancing the customizability of your workspace. In PhpStorm 2023.3, we’re expanding this functionality by introducing the Default layout option, which provides a quick way to revert your workspace’s appearance to its default state. This layout is not customizable and can be accessed via Window | Layouts.

Color-coded editor tabs by default

Color-coded editor tabs by default

To make it easier to work with a variety of file types in the editor at the same time, we’ve introduced color-coding for editor tabs by default, mirroring their appearance in the Project tool window.

TypeScript improvements

TypeScript improvements

Packed with WebStorm features, PhpStorm now addresses some of the frustrating inconsistencies that occur when adding import type statements, and it makes working with verbatimModuleSyntax easier. We’ve added the option to configure the kind of TypeScript import type statement. We’ve also improved the behavior for the exports field of package.json for TypeScript files.

HTML to JSX single tag closing

HTML updates

Now, when you paste HTML code into a JSX file, not only will PhpStorm convert attributes, but it will also automatically close single tags for you. You can configure this option under Settings | Editor | General | Smart Keys | JavaScript.

CSS custom @property support

CSS enhancements

To support the new @property API for creating custom CSS properties, PhpStorm 2023.3 now offers inspections and completion features for explicitly defining CSS custom properties, allowing you to check and restrict property types, establish default values, and determine inheritance possibilities for custom properties.

Improvements for Vue 3

Improvements for Vue 3

We’ve added support for defineSlots, providing completion and navigation for the slot name, as well as the Rename refactoring. We’ve also introduced completion support for properties with defineExpose. In PhpStorm 2023.3, required imports for components will be added based on the name specified by the defineOptions function.