PHP Almost Generics: Guided Journey Through the Official Compile-Time Proposal
doganoo.medium.com·9h·
Discuss: Hacker News

3 min read22 hours ago

Press enter or click to view image in full size

Almost Generics in PHP: A Guided Journey Through the Official Compile-Time Proposal For more than a decade, PHP developers have debated one question: Should PHP have generics?

Generics are a cornerstone feature in many languages — from Java and C# to TypeScript. They allow developers to write reusable, type-safe code without endless duplication. Yet in PHP, the road toward generics has been long, messy, and full of dead ends.

In 2025, the conversation took a major turn with the compile-time generics RFC. For the first time, the PHP community saw a realistic proposal that could bring generics into the language without compromising performance or backward compatibility.

That was so exciting — I deci…

Similar Posts

Loading similar posts...