AI Wrote a PHP Engine in Rust, Passes 17% of PHP-src Tests, Renders WordPress

✍️ OpenClawRadar📅 Published: July 5, 2026🔗 Source
AI Wrote a PHP Engine in Rust, Passes 17% of PHP-src Tests, Renders WordPress
Ad

Someone who doesn't know Rust just had an AI build a PHP interpreter in it. The result, Phargo, serves a 26 KB WordPress front page from a SQLite database — through an engine containing zero lines of PHP's actual C source code. It's a from-scratch interpreter written in Rust, generated by an AI agent with the human's role reduced to: run tests, inspect score, say "continue" or "regressed, look again."

The experiment uses PHP's own test suite as an impartial oracle: ~22,000 .phpt files accumulated over 30 years, covering everything from DateTime daylight-saving math to var_dump() on floats. Current pass rate: 3,844 of 22,037 (17.4%). Because the suite includes C extension tests (GD, curl, SOAP, MySQL drivers) that are out of scope, the realistic ceiling is ~40-45%. The project started at zero and climbs via failure histograms: the AI identifies the biggest cluster of failing tests, implements a fix, runs the full 22,000-test suite (~7 minutes), and commits if the number goes up — no human code review needed.

Ad

Lessons from the Trenches

Early progress plateaued from a subtle bug: line endings. The test corpus was checked out on Windows with CRLF endings, and the scoreboard compared output byte-for-byte, silently failing every multi-line test. PHP's own test runner normalizes before comparison. One line of normalization code turned hundreds of tests green. The lesson: measure your measurement — your oracle is only as honest as the harness connecting you to it.

Another discovery: some older regression tests allocate absurd structures or expand into infinite generators, originally designed to run inside PHP's carefully-fenced CI. One such test hard-restarted the development machine. The project now filters tests that are known CI-only bombs.

The Loop

  • AI runs a failure histogram over the whole corpus to find the biggest fixable cluster.
  • AI implements the fix.
  • Scoreboard runs all ~22,000 tests (~7 minutes).
  • If the number goes up: commit, push, repeat.
  • If it goes down: human says "hmm, that regressed, look again."

The human's job is essentially aiming — reading terminal output like a medieval king reviewing naval charts, then typing the developer's most powerful phrase: "looks good, continue."

📖 Read the full source: HN AI Agents

Ad

👀 See Also

Tencent Hosts Free OpenClaw Installation Event in Shenzhen Amid High Demand
News

Tencent Hosts Free OpenClaw Installation Event in Shenzhen Amid High Demand

Tencent organized 20 employees outside its Shenzhen office building to install OpenClaw for free on March 6, responding to reports of people paying over $70 for house-call installation services. The event used Tencent Cloud's Lighthouse platform, with most attendees being white-collar professionals facing workplace competition and AI adoption pressure.

OpenClawRadar
Qwen 3 8B outperforms larger models in blind peer evaluations on hard tasks
News

Qwen 3 8B outperforms larger models in blind peer evaluations on hard tasks

In a blind peer evaluation of 10 small language models on 13 hard frontier-level tasks, Qwen 3 8B won 6 evaluations and placed in the top 3 in 12 of 13 tasks, outperforming models with up to 4x its parameter count. The evaluation covered distributed lock debugging, Go concurrency bugs, SQL optimization, Bayesian medical diagnosis, Simpson's Paradox, Arrow's voting theorem, and survivorship bias analysis.

OpenClawRadar
Reddit user compares Claude Sonnet 4.6 and GPT-5 on 10 blogging tasks
News

Reddit user compares Claude Sonnet 4.6 and GPT-5 on 10 blogging tasks

A Reddit user tested Claude Sonnet 4.6 against GPT-5 using identical prompts for 10 common blogging tasks, finding the editing time difference to be the most useful metric.

OpenClawRadar
🦀
News

Claude Code v2.1.140: Agent tool usage notes, stricter Self-Modification rules, Snooze warnings

Agent tool simplified notes, explicit Self-Modification path list, and a warning against short-interval snooze wakeups for polling.

OpenClawRadar