

Here is a simple example of the annotated collection class: In short, you get more bug-free code and better code completion. Check out the Generics and why we need them post by Brent Roose to learn more about the advantages of this approach over arrays. In PhpStorm 2021.2, you can use generic class collections. Collections with of the most popular applications of generics is collections. This approach was popularized by static analysis tools such as Psalm and PHPStan. In this release, we are adding basic support for generics via PHPDoc annotations. Read this blog post for details about all the significant updates, demonstrated through a ton of GIFs! PHP Support for genericsĪlthough generics is one of the most requested features for the PHP language according to the JetBrains Developer Ecosystem survey, there are no plans to add them any time soon.

Automatic clean-up of caches and log directories.Here are the main highlights of the release: PHP

This major release introduces preliminary support for generics in PHP, enums for PHP 8.1, one-line array shapes, improved automatic formatting of PHP code, new inspections and refactorings, and much more.
