// the find
peachpiecompiler/peachpie
PeachPie - the PHP compiler and runtime for .NET and .NET Core
PeachPie compiles PHP source code to .NET CIL, running it on the CLR instead of the Zend engine. The pitch is bidirectional interop — call C# from PHP and PHP from C# — which makes it interesting for teams that want to migrate legacy PHP gradually or run PHP code inside a .NET host. It is not a PHP-to-C# transpiler; it produces proper IL that runs on the runtime.
Built on Roslyn, so the compiler infrastructure is not hand-rolled: PE emission, analysis pipeline, and diagnostic reporting all come from a battle-tested base. The ASP.NET Core middleware integration is genuine — PHP apps run inside Kestrel's request pipeline and get DI, session, and auth from the .NET stack rather than reimplementing them. Flow-based type inference lets the compiler eliminate dynamic dispatch on variables it can pin to a concrete type, which matters for performance. PDO is implemented with pluggable drivers (MySQL, Postgres, SQLite, SQL Server), so the database layer of common PHP apps has a real shot at working.
PHP's ecosystem runs on C extensions — imagick, redis, swoole, xdebug — and none of those translate; anything that depends on a native extension is a hard stop. The nightly builds are gated behind Patreon, which is a strange model for an open-source compiler and a red flag for production adoption. The CI badges show AppVeyor with VS 2019 and an Azure DevOps pipeline that looks unmaintained, suggesting the release pipeline has drifted. Real-world compatibility with WordPress or Laravel remains incomplete; PHP's dynamic typing means edge cases in dynamic variable variables, eval, and runtime class loading are genuinely hard to get right, and the roadmap page has been 'in progress' on several of these for years.