Swoole AOT is officially becoming TypePHP

· X (formerly Twitter) ·

2 min read Original article ↗

While generics are failing the vote, here's a continuation of the Swoole AOT compiler story (wrote about it earlier). It is now officially renamed to TypePHP. They mentioned this briefly last time, but now saying it outright — it's a separate strongly-typed compiled language.

The beta is promised by October 2026, and they're going to make it open-source. Strictly speaking, open source doesn't mean free, but I take it that's the implication.

How it works

The syntax is compatible with PHP, but it compiles to native machine code instead of ZendVM opcodes.

That said, they've kept ZendVM itself inside as a runtime too. It means, statically compiled code can load regular .php files at runtime via require/include. And all your Composer packages, autoloading, and extensions (curl, PDO, mysqli, Swoole) — all of it should work.

What else is cool

  • Native Decimal, BigInt, BigFloat. Meaning 0.1 + 0.2 gives exactly 0.3, with no precision loss.
  • Typed containers on top of the universal arrays: std::vector, std::map, std::unordered_map with defined key and value types.
  • Uniform function call syntax (UFCS) + extension methods.
    You can call any function as a method on any type! — Whaaaat?! You could do that all along??

But ☝️

The further it goes, the less it's PHP. We've seen this before: Facebook made "fast PHP" → it turned into Hack → a separate language → the ecosystem split → and here you are.

Either way, it's good to see things moving, especially if they actually release the code under an MIT-like license. We'll see in October.