When Modernization Breaks Working Code: A Study of LLMs on Legacy PHP arxiv.org ...

@best

When Modernization Breaks Working Code: A Study of LLMs on Legacy PHP arxiv.org · 10 points · 4 comments · HN thread

TL;DR A 2026 arXiv paper tests five LLMs asked to modernize 100 WordPress 4.0 PHP files to PHP 8.3 with no project context or execution feedback, checking results against 630 hidden behavioral tests and 511 Rector-detected modernization findings. Untouched originals pass every check for 83 files, the best LLM for only 59, and each model breaks 32-51 working files while repairing at most 10, versus Rector breaking 7 and repairing 6.

  • Five LLMs were each asked to modernize 100 WordPress 4.0 PHP files to PHP 8.3 while preserving behavior, with a single-file, one-shot setup.
  • Untouched originals pass all 630 hidden behavioral checks for 83 files; the best LLM passes only 59 of those files.
  • Each LLM breaks 32-51 files that previously worked and repairs at most 10; the rule-based tool Rector breaks 7 and repairs 6.
  • Only 37 findings (7 percent) actually require a change under PHP 8.3, yet LLMs break 36-60 percent of compatible files that needed no change (Rector: 8 percent).
  • Most regressions come from files that no longer load, often due to type declarations PHP rejects, errors avoidable without project context.
  • The authors recommend measuring LLM modernization against a no-change baseline and reporting modernization and behavior preservation separately.

Discussion The thread is short and split between methodology criticism and a note that models have improved quickly. One commenter argues the one-shot, no-iteration setup is unrepresentative since agentic tools that iterate on errors are a major reason LLM coding tools are useful now. Another questions whether anyone really develops software by pasting single files into a chat assistant. A third points out that the listed models (Claude Sonnet, Gemini 2.5 Flash and Pro, GPT-5 Codex, Llama 3.3 70B) are dated, making the results look less relevant. A further commenter reports that LLM-assisted modernization has become their first choice when used carefully. The mood is skeptical of the study's relevance rather than of its numbers.

  • Single-file, no-feedback methodology is unrepresentative of real use (many): Commenters note the study evaluates the first answer from a chat assistant without iterating on errors or seeing callers. They argue agentic tools that loop on compiler and test feedback are the setup that actually works.
  • Results are outdated because LLMs improve quickly (some): One commenter notes the tested models are older, such as Gemini 2.5 and Llama 3.3, and that rapid progress makes the findings less relevant today.
  • Pasting single files into a chat is not how developers work (some): One commenter questions whether anyone really develops software this way, suggesting the setting is an artificial simplification.
  • Careful LLM use now produces very good modernization (a few): A commenter who was skeptical a year ago now considers LLMs the first choice for this task when used carefully, reporting very good results.

#LLMs #PHP #legacyCode #codeModernization #benchmarks #Rector