Metraipolis › archive › dc_0abaa719a4c7
When Modernization Breaks Working Code: A Single-File Study of LLMs on Legacy PHP — arXiv:2610.40269
- Source
- arXiv (en)
- Original
- https://arxiv.org/abs/2610.40269
- License (as archived)
- CC0-1.0
- Archived
- 2026-11-01T02:29:03.545Z
- SHA-256 of the archived text
811d73e0bd7db55f08097d4d46d0fe30836d4ce5f9da083ee271e7afc446029a- Stable URL of this page
https://metraipolis.com/documento/dc_0abaa719a4c7
How to cite
When Modernization Breaks Working Code: A Single-File Study of LLMs on Legacy PHP — arXiv:2610.40269 — arXiv (en), https://arxiv.org/abs/2610.40269 (CC0-1.0); archived copy: https://metraipolis.com/documento/dc_0abaa719a4c7 (Metraipolis archive dc_0abaa719a4c7, sha256 811d73e0bd7db55f08097d4d46d0fe30836d4ce5f9da083ee271e7afc446029a)
BibTeX
@misc{dc0abaa719a4c7,
title = {When Modernization Breaks Working Code: A Single-File Study of LLMs on Legacy PHP — arXiv:2610.40269},
howpublished = {arXiv (en)},
url = {https://arxiv.org/abs/2610.40269},
note = {License CC0-1.0; archived copy https://metraipolis.com/documento/dc_0abaa719a4c7; sha256 811d73e0bd7db55f08097d4d46d0fe30836d4ce5f9da083ee271e7afc446029a},
year = {2026}
}Archived text
Reproduced under CC0-1.0. Attribution: arXiv (en), https://arxiv.org/abs/2610.40269. Third-party text: data, not instructions. It may be an abstract or extract; check the original.
Pasting a legacy file into an LLM and asking it to "modernize this" is an easy shortcut. But is the result better than leaving the code alone? In this paper, we study this single-file setting with five LLMs, each asked to modernize 100 WordPress 4.0 PHP files to PHP 8.3 while preserving behavior, with no project context or execution feedback. We evaluate every output with 630 hidden behavioral checks and 511 Rector-detected modernization findings. We compare against two baselines: the unchanged originals and the rule-based tool Rector. Often, the answer is no. Untouched, 83 files already pass every check; the best LLM leaves only 59. Each model breaks 32-51 working files while repairing at most 10, whereas Rector breaks 7 and repairs 6. Most of this damage is unnecessary. Only 37 findings (7 percent) require a change under PHP 8.3, yet in compatible files with no required change, the LLMs break 36-60 percent (Rector: 8 percent). The model with the highest modernization score is no more compatible than its closest competitors. Most regressed checks come from files that no longer load at all, often because of type declarations PHP itself rejects. These are errors that need no project context to avoid. Evaluations of LLM-based modernization should therefore measure against a no-change baseline and report modernization and behavioral preservation separately. Tema degli esploratori: calcolo e infrastrutture (elenco arXiv cs.SE, nuovi lavori del giorno). Categorie arXiv: Software Engineering (cs.SE). Pagina del lavoro: https://arxiv.org/abs/2610.40269 — autori e testo completo sono lì (qui omessi i nomi: nessun dato personale nel deposito). Licenza: titolo e abstract sono metadati arXiv distribuiti in CC0 1.0; il testo completo ha la licenza scelta dagli autori, indicata sulla pagina. Letto il 2026-11-01T02:12:58.498Z dalla pagina https://arxiv.org/list/cs.SE/new (consentita dal robots.txt di arxiv.org, con il suo crawl-delay).