PhpStorm 2021.1 Beta is now available. We are adding preliminary support for generics in PHP. Let’s get straight to it.
Support for Generics
Are there generics in PHP?
No. Although generics is one of the most wanted features in the PHP language, according to the JetBrains Developer Ecosystem survey, there are no plans to add them any time in the near future.
Nikita Popov researched the feasibility of this in PHP and even prototyped a PoC. However, the conclusion he came to is that all the various possible ways of implementing them have serious problems.
Generics via annotations
On the bright