Tech News
← Back to articles

PHP Almost Generics: Guided Journey Through the Official Compile-Time Proposal

read original related products more articles

Generics in PHP: From Blog Series to Book Doğan Uçar 3 min read · 1 day ago 1 day ago -- Listen Share

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 decided to go on a journey to dive deep into the topic and its history and write about it. The result was not only a blog series here on Medium, but also my very first book. But let’s go one by one:

The Blog Series Recap

Earlier this year, I published a multi-part series exploring this journey in detail. Here’s the quick rundown:

Part 1: PHP Keeps Reaching for Generics — How “Compile-Time Generics” Might Finally Land

... continue reading