A PHP internals mailing list discussion about a proposed RFC for bound-erased generic types in PHP. The RFC proposes adding generic type parameters to classes, interfaces, traits, functions, methods, closures, and arrow functions, with bounds, defaults, and variance markers. Type parameters erase to their bound at runtime, while the pre-erasure form is preserved for Reflection and static analyzers. The discussion covers key design decisions including: type parameter ordering restrictions, intersection type constraints, arity validation (opt-in via turbofish syntax), diamond inheritance checks, turbofish syntax vs alternatives, +/- variance markers vs in/out keywords, and the path toward future reified/runtime generics.
102 Impressions