AI Rewrites PHP Engine in Rust: Already Renders WordPress, Passes 17% of Official Tests
AI Rewrites PHP Engine in Rust: Alread…
AI-assisted Rust PHP engine passes 17% of official tests and renders WordPress pages.
A developer built a PHP execution engine in Rust using AI assistance, achieving ~17% pass rate on the official php-src test suite and successfully rendering WordPress. The project showcases both the potential and real limitations of AI in complex systems programming, highlighting a promising TDD-AI development paradigm.
An AI-Driven Experiment
A developer recently shared an ambitious experimental project on Hacker News: building a PHP execution engine from scratch in Rust, with AI assistance. The engine currently passes roughly 17% of the official PHP test suite (php-src tests) and can successfully render WordPress pages.
That number may not sound impressive, but PHP is a dynamically-typed language with over two decades of history and extraordinarily complex semantics. Given that most of the code was generated by AI, a 17% pass rate is actually a thought-provoking signal — one that reveals the real capability limits of today's large language models when tackling large, complex, systems-level engineering tasks.
Why Rewrite a PHP Engine in Rust?
Chasing Both Performance and Memory Safety
The official PHP engine, the Zend Engine, is written in C. Since its release with PHP 4 in 1999, it has gone through multiple major revisions — most notably Zend Engine 3, which shipped with PHP 7 and delivered up to a 2× performance improvement. At its core, the Zend Engine is a register-based virtual machine: PHP source code is lexed, parsed, and compiled into intermediate bytecode (opcodes), which the VM then interprets. The C implementation delivers high performance, but it has long carried memory safety risks — memory leaks, dangling pointers, and Use-After-Free vulnerabilities in PHP processes have been recurring topics in the security community.
Rust, built around its Ownership, Borrowing, and Lifetime system, performs static analysis of memory allocation and deallocation at compile time, eliminating this class of bugs entirely — and without the runtime overhead of a garbage collector. For a system like a PHP engine that constantly manages dynamically-typed values and reference-counted objects, Rust's zero-cost abstractions make it theoretically ideal: memory safety without sacrificing execution speed.
The idea of rewriting a PHP engine in Rust isn't new — the community has seen similar attempts before. What makes this project distinctive is that a large portion of the implementation work was handed off to AI, with the developer playing the role of architect and "acceptance reviewer," gradually filling in language feature implementations through continuous human-AI collaboration.
What Does Rendering WordPress Actually Mean?
Successfully rendering WordPress is a genuinely compelling milestone. WordPress powers over 40% of the web, with a codebase spanning hundreds of thousands of lines of PHP. It relies heavily on advanced PHP features — magic methods (__get, __call, etc.), dynamic variable names, serialization and deserialization, the PCRE regex engine, and a complex Hook and Filter architecture. WordPress also requires database interaction and filesystem operations, meaning the engine needs not just a correct PHP language core, but basic extension ecosystem support as well.
Being able to run WordPress means this engine has crossed the critical threshold from "language toy" to "practical interpreter" — implementing a substantial portion of PHP's core semantics, well beyond a "Hello World" validation.
What AI-Assisted Large-Scale Systems Development Really Tells Us
The Engineering Reality Behind 17%
To appreciate the weight of that 17% figure, you first need to understand what's being tested. The official php-src test suite (in phpt format) currently contains over 16,000 test cases, covering everything from basic type semantics and operator behavior to string library functions, object-oriented features (interfaces, traits, anonymous classes), generators, Fiber coroutines, and a long tail of legacy edge-case behaviors. Take PHP's famous weak type comparison rules (0 == 'foo' was true in PHP 7 but changed to false in PHP 8) — these cross-version historical shifts must be precisely covered, and they're exactly the kind of high-difficulty territory where AI is most prone to errors.
A 17% pass rate is a reminder that AI-generated code still faces enormous challenges with "long-tail complexity." Current large language models show a clear pattern in systems programming: strong on high-frequency knowledge, weak on the long tail. For mainstream API usage and common algorithm implementations backed by abundant training data, AI can generate high-quality code. But for edge-case semantics glossed over in a single sentence of a spec, or version-specific compatibility behaviors, AI tends toward "reasonable inference" rather than strict specification adherence — producing implementations that look plausible but behave incorrectly. This is fundamentally at odds with the extreme correctness demands of interpreter development.
In other words, AI can quickly scaffold an engine that "looks like it works" and can even run mainstream applications — but closing the remaining 83% gap to reach production-grade completeness and correctness may require far more effort than the first 17% did. This is a textbook example of the classic "last mile" problem in software engineering.
A New Human-AI Development Paradigm
This project puts into practice an emerging paradigm: test-driven AI development (TDD-AI), using a standard test suite as an objective, automated acceptance signal to drive targeted code generation and iterative repair by AI. The quantifiability of the test suite (pass rate improving from X% to Y%) gives AI a clear optimization target, avoiding the ambiguity of natural language requirements and enabling a continuous, automated "AI writes code, tests verify it" iteration loop.
This paradigm shares the spirit of traditional TDD, but hands off the "write the code" step to AI at scale. In domains that similarly possess high-quality standard test suites — open-source compiler infrastructure (like LLVM's test suite), database engines (SQLite's extensive test set) — this approach has tremendous replicability potential and could see broader adoption in systems software, compilers, and interpreters.
A Balanced View: Opportunity and Limitation Coexist
Exploration Value Worth Acknowledging
Regardless of whether this project ever becomes a usable PHP implementation, it is an excellent stress test of AI programming capabilities in its own right. By placing AI in a knowledge-intensive, detail-heavy, near-zero-tolerance real-world scenario, it provides the developer community with valuable empirical reference data.
The Reality Gap to Stay Clear-Eyed About
Between 17% and near-100% compatibility, between "can render WordPress" and "can safely run arbitrary production code," lies an enormous chasm. Language implementation correctness, performance tuning, ecosystem compatibility, security auditing — every one of these is a hard problem that AI currently cannot tackle independently. Human experts must remain in the lead. The security dimension is especially critical: a large number of historical PHP CVEs stem from improper handling of edge cases at the engine level. The correctness of these details cannot be guaranteed by AI's "roughly reasonable" inferences.
Conclusion
Building a Rust-based PHP engine with AI is a technically idealistic experiment. The 17% pass rate is both an achievement and a mirror — reflecting the true state of AI-assisted programming: it can dramatically accelerate prototype development and skeleton construction, and can keep iterating forward in a test-driven feedback loop, but human experts must still lead on key decisions, edge cases, and quality assurance.
For developers following the future of AI-assisted programming, the ongoing progress of projects like this is far more instructive than any theoretical discussion. It's worth watching to see just how high that number can climb under a human-AI collaboration model.
Key Takeaways
Related articles

The Truth Behind Codex 'Build a Website in 5 Minutes': AI Isn't Creating Sites—It's Helping You Copy Them
Exposing the truth behind viral Codex 5-minute website videos: creators aren't building original sites with AI—they're copying shared prompts or scraping others' work. Learn AI coding tools' real limits.

Getting Started with AI Agent Development: A Complete Guide from Concept to Practice
A comprehensive guide to AI Agent architecture and development, covering automated marketing, intelligent customer service, and investment analysis scenarios with single and multi-agent collaboration.

The Truth Behind Codex 'Build a Website in 5 Minutes': AI Isn't Creating Sites — It's Helping You Copy Them
Exposing the truth behind viral Codex 5-minute website videos: creators aren't building original sites with AI — they're copying shared prompts or scraping others' work.