Generics have been on the list of wanted features for a long time by numerous PHP developers. The topic is often brought up in “What’s New in PHP?” talks as well during Q&A. By Arnaud Le Blanc, Derick Rethans, Larry Garfield.
In this article we will be exploring the different approaches, and what their current state is.
- Full Reified generics
- Collections
- Other alternatives
- Static Analysis
- Erased Generic Type Declarations
- Fully Erased Type Declarations
- Generic Arrays
- Fluid Arrays
- Static Arrays
Authors hope to have explained in this article what different options are available for the implementation of generic objects, collections, or related features into PHP. More work is required, and ongoing, to determine which options are most desireable, or even feasible. Good read!
[Read More]