They Said No to Generics… So Swoole Built TypePHP

nunomaduro| 00:06:24|Jun 17, 2026
Chapters6
The generics RFC was rejected, sparking strong community reactions and skepticism about adopting generics in PHP given differing opinions.

Swoole launches Type PHP, a compiled binary approach that could redefine PHP performance and introduce built-in method calls on primitives, while generics chances fade for now.

Summary

Nuno Maduro walks through a seismic shift in the PHP world: the generics RFC was rejected, shaping a bleak outlook for native generics in PHP for now. On the same day, Swoole unveiled Type PHP, a compiled variant of PHP that ships a binary to production rather than raw PHP source. Nuno explains that Type PHP promises performance gains comparable to Rust or Go, with the binary handling static analysis and routing requests to the compiled code. He highlights that Fibonacci benchmarks show Type PHP performing 135x faster than interpreted PHP and 20x faster than typical JIT setups. Importantly, the compiler can work with existing, less-typed code, falling back to the interpreted path for legacy segments. Beyond speed, Type PHP introduces features like fixed-length arrays, dynamic arrays, orderly mapping, and hash mapping, with a standout capability: method calls on built-in types (for example, string lowering via a method call). He notes this could finally satisfy long-standing community desires for fluent, native-style operations. The video places Type PHP as a potential future for PHP—able to coexist with Laravel, Symfony, WordPress, and Drupal while aiming to be as modern as Rust or Go. Nuno pins October 2026 as the release target and references Elephant Sea as a prior attempt worth comparing. He closes with enthusiasm for sponsors and a nod to the broader PHP ecosystem.

Key Takeaways

  • Generics were rejected in PHP, with voting revealing divergent opinions on how generics should work or be implemented.
  • Type PHP ships as a production binary instead of shipping PHP source, promising performance gains similar to compiled languages.
  • Fibonacci benchmarks claim 135x speedups over interpreted PHP and 20x over typical JIT setups.
  • The compiler handles static analysis, enabling compiled paths for typed code while still supporting legacy, less-typed code via an interpreted fallback.
  • New language features include fixed-length arrays, dynamic arrays, orderly mapping, and hash mapping, plus built-in method calls on strings and numbers.
  • Type PHP aims to integrate with existing ecosystems (Laravel, Symfony, WordPress, Drupal) and is slated for an October 2026 release.
  • Elephant Sea is another attempt in this space and is worth comparing to Type PHP when evaluating compiled PHP options.

Who Is This For?

PHP developers and architecture decision-makers curious about performance boosts and modern language features, especially those maintaining Laravel, Symfony, WordPress, or Drupal apps who want to understand how a compiled PHP might affect their stack.

Notable Quotes

"The generics RFC just got rejected into PHP."
Sets the premise that native PHP generics are unlikely in the near term.
"Type PHP end up being the future of PHP just increased exponentially."
Emphasizes the optimistic impact of the Type PHP announcement.
"By the nature of moving from an interpreted language to a compiled language, we have performance improvements."
Highlights the core advantage of Type PHP.
"Fibonacci basically is 135 times faster on type PHP versus regular PHP if we go down the interpreted path, but also 20 times faster than jit."
Specific benchmark claim used to illustrate performance potential.
"The compiler architecture is actually super smart and will work as well with existing code that not be fully typed."
Describes compatibility with legacy PHP code.

Questions This Video Answers

  • What is Type PHP and how does it differ from standard PHP?
  • Will Type PHP replace PHP's current interpreter or coexist with it?
  • How does Type PHP handle legacy code that isn’t fully typed?
  • When is Type PHP expected to release and what can we expect in October 2026?
  • How do static analysis and compiling affect PHP performance compared to JIT?
PHPType PHPSwoolegenerics RFCPHP internalscompiled PHPstatic analysisbinary deploymentFibonacci benchmarkLaravel
Full Transcript
The generics RFC just got rejected. The community is super angry with the PHP internals and the Swoole team just announced type PHP. I don't know if you guys are ready, but things are about to get hot. Now, before we jump into the video, make sure you click the subscribe button. Yeah, that one right there. Go click it. That's the best way to support my channel. All right, first things first, generics just got rejected into PHP. So, the likelihood that we are going to have generics ever on PHP just decreased hardcore. Now, it's important to clarify that most of the people who have said no, they actually want generics on PHP. However, they want generics a little bit different. That's why I think we are going to never see generics on PHP because the people's opinion and how generics should behave or be, they actually change quite drastically between people who vote. And yes, there is various ways you can implement generics in PHP. The very first one is bound it is generics, which was the one proposed on this RFC. And that way of having generics is very similar to Python, meaning that generics wouldn't actually mean anything at runtime, but at static time, static analysis, things like PHP standard or Psalm, they will be able to read those generics and actually showing you if you have any problems. We could potentially also have another type of generics, which is monomorphized generics, which is basically having types just like we have today in PHP that they break at runtime. However, actually checking times regarding generics at runtime can have a performance hit. Therefore, some of the people don't actually agree on it. Meaning that we are left with number three, meaning that we are not going to have generics probably ever. I mean, with the current state of things where multiple people are voting for this, everyone have different opinions, plus we have this beautiful UI to actually express our opinion, the likelihood that we have generics is just 0% at this point. Now, on the same day the generics RFC got rejected, the Swoole team just renamed their compiler to type PHP. I don't know if you get this, but the likelihood that this type PHP end up being the future of PHP just increased exponentially. Quick 5 seconds just to say thanks to all my sponsors. You guys are awesome to make my dream come true. Now, what is type PHP? It's basically another version of PHP. You can see it as a fork of PHP almost. And what it does is that today we have a request which goes down the interpreted path, meaning that every single time we have a request, we are going to read PHP files, every single one of them actually, and then we produce a response. With type PHP instead, instead of shipping PHP in the source code to the server, we are going to actually simple ship a binary to production. Very similar to Rust or Go, meaning that we actually have performance improvements that are similar to those languages. Now, the binary goes to production, and when you get a request, you are going to actually send that request to the binary, and that will produce a response as well. Now, what is interesting about this as well is that the binary itself is the one performing static analysis, and we wouldn't need anything like PHP stand to do it as well, which is absolutely awesome. Now, besides new features that we can hypothetically have with this new type PHP, which we are going to talk about this in a second, it also brings a bunch of performance improvements. Basically, by the nature of moving from an interpreted language to a compiled language. Just check this out. Fibonacci basically is 135 times faster on type PHP versus regular PHP if we go down the interpreted path, but also 20 times faster than jit, which is currently the way that most applications ship PHP to production. Now, something really interesting with type PHP is that the compiler architecture is actually super smart and will work as well with existing code that not be fully typed. And here is actually super simple. If the current syntax you are giving is actually super supported by this new type PHP system, then it will go through the path that is compiled and everything. However, if you have any current code which might be a little bit legacy, missing a few types here and there, will actually go through the existing interpreted path. So, that will just work, which is fantastic. Now, this new type PHP comes with various features including fixed-length arrays, dynamic arrays, orderly mapping, and hash mapping, but I really want to show you something really, really sexy. And yes, we are talking about method calls on built-in types. This effectively means that you can have a string like "Hello World" and then you can do things like lowering that string just by performing a regular method call. This stuff is absolutely huge and probably one of the most requested things ever on the PHP industry. Now, not only on strings, but also in things like numbers, you can literally do a equals to two do pow a t to string length. Like, I have this fluent API that today we have with Laravel thanks to many of the Laravel classes, but like this will be just built-in on PHP core. How huge this is. Now, let's go to the one million-dollar question. Do you know why I think the Swirl team decided to announce type PHP today on the precise day the PHP internals team decided to reject generics on the core? It's because they are going to probably have generics coming to type [music] PHP as well. I think type PHP will be potentially everything the community ever wanted from PHP. Be a language that works with the current legacy code, with the current Laravel apps, Symphony apps, WordPress, and Drupal, but at the same time be as modern as Rust, as Go, and all those modern languages. Now, my friends, in terms of dates, type PHP is coming out in October 2026. This is exactly what we see on the article, but also on a tweet from Albert Chain. Okay, this is the update from the official Swoole team, and this is apparently when Type PHP is coming out to the world. Now, keep in mind this Type PHP is not actually the very first attempt of someone bringing this compiled language or compiled world to PHP. There is also Elephant Sea, which I actually have a full video about that that you can check right here. [music] And that's it for this video. I would really appreciate if you guys could click on the like button, but also on the subscribe button if you want to see more about me. I love you all. I love PHP, and catch you guys next time. Bada boom bada bing bada boom. [laughter]

Get daily recaps from
nunomaduro

AI-powered summaries delivered to your inbox. Save hours every week while staying fully informed.