2026-11-26 15:40 UTC

Study finds LLMs regress legacy PHP files in a single-file migration test

state: seedheat: mediumuncertainty: mediumrelevance: highcoding-agents legacy-code software-reliabilityAfridi MahmudAbid Hasan KhondakerSadif AhmedMd Nafiu RahmanRifat Shahriyar

What is this?

A paper by Afridi Mahmud, Abid Hasan Khondaker, Sadif Ahmed, Md Nafiu Rahman, and Rifat Shahriyar, submitted to arXiv on 29 October 2026, tests whether LLMs can modernize legacy PHP code without breaking behavior. In a single-file setup, the authors asked five models to update 100 WordPress 4.0 files for PHP 8.3, without project context or execution feedback, and checked outputs against 630 hidden behavioral checks and 511 modernization findings. The paper reports that 83 untouched files passed all checks; each LLM broke 32–51 previously passing files and repaired at most 10, while the rule-based tool Rector broke 7 and repaired 6. The evidence is the paper’s own reported experiment, not an independent replication, and its scope is limited to this dataset and setup.

Why it matters

This challenges the assumption that a more modern-looking codebase is necessarily a safer one. In the tested setting, leaving compatible code unchanged often beat asking an LLM to rewrite it, and a deterministic migration tool caused fewer regressions. For real modernization work, the findings support measuring behavioral preservation against a no-change baseline and using tests or other verification before deploying generated changes. The study does not establish that LLMs are generally worse at code migration, especially with project context, execution feedback, or different tasks.

Current assessment

New research evidence: the arXiv paper, submitted 29 October 2026, reports a controlled single-file test of five LLMs on 100 WordPress 4.0 PHP files targeted for PHP 8.3. With no project context or execution feedback, each model broke 32–51 files that had passed behavioral checks and repaired at most 10; Rector broke 7 and repaired 6. The unchanged baseline already passed all checks for 83 files. The authors say only 37 of 511 modernization findings (7%) required changes under PHP 8.3, and that most regressions came from files failing to load, often due to invalid PHP type declarations. Their conclusion is that evaluations should measure behavior preservation separately from modernization and include a no-change baseline. These are author-reported results from one dataset and experimental design; they do not show how the models would fare with broader repository context, iterative execution and repair, or other languages and migrations. A web result points to Zenodo dataset and project materials, but the supplied evidence does not independently verify the findings or establish adoption.

Measured heat

now 0 pts/hpeak 0 pts/hcomments 0/hpeers p10momentum: steady2 platformsage 698h
points/hour across evidence · reading as of 2026-11-27 02:23:58.509736+11:00 · deterministic, not a model opinion

How the heat travelled

10-28 13:00⭐ origin echo-reconstructedThe paper reports that, on 100 WordPress 4.0 PHP files modernized toward PHP 8.3, each tested LLM broke 32–51 files that had passed behavior
Afridi Mahmud, Abid Hasan Khondaker, Sadif Ahmed, Md Nafiu Rahman, and Rifat Shahriyar on paper (echo) · attributed from hn.story.50330033
—
11-01 21:22first on hacker news · published · +104.4hWhen Modernization Breaks Working Code: A Study of LLMs on Legacy PHP
tambourine_man
—
11-01 21:22amplified on hacker news 👑hn.story.50330033
tambourine_man
peak 22 · 14 comments · 100% of case engagement
11-01 22:21our radar first saw it · +105.4hdiscovery anchor: hn.story.50330033—
pace: p68 vs 1845 stories at the 336h mark (now 698h old) — ahead of anthropic-claude-real-world-exploit-chains (1.0x), behind gufo-strix-halo-engine (1.0x)

Evidence (2) — ⭐ canonical anchor

sourceobjectauthorscorecomments
🟧 hnWhen Modernization Breaks Working Code: A Study of LLMs on Legacy PHP
Retrieved article excerpt

Open article · Retrieved 2026-11-01T22:22:38.710011+00:00

# Computer Science > Software Engineering

**arXiv:2610.40269** (cs)

[Submitted on 29 Oct 2026]

# Title:When Modernization Breaks Working Code: A Single-File Study of LLMs on Legacy PHP

Authors:[Afridi Mahmud](https://arxiv.org/search/cs?searchtype=author&query=Mahmud,+A), [Abid Hasan Khondaker](https://arxiv.org/search/cs?searchtype=author&query=Khondaker,+A+H), [Sadif Ahmed](https://arxiv.org/search/cs?searchtype=author&query=Ahmed,+S), [Md Nafiu Rahman](https://arxiv.org/search/cs?searchtype=author&query=Rahman,+M+N), [Rifat Shahriyar](https://arxiv.org/search/cs?searchtype=author&query=Shahriyar,+R)

View a PDF of the paper titled When Modernization Breaks Working Code: A Single-File Study of LLMs on Legacy PHP, by Afridi Mahmud and 4 other authors

[View PDF](https://arxiv.org/pdf/2610.40269)
[HTML (experimental)](https://arxiv.org/html/2610.40269v1)
> Abstract: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.

|  |
| --- |
| Comments: |
| Subjects: | Software Engineering (cs.SE) |
| Cite as: | [arXiv:2610.40269](https://arxiv.org/abs/2610.40269) [cs.SE] |
|  | (or  [arXiv:2610.40269v1](https://arxiv.org/abs/2610.40269v1) [cs.SE] for this version) |
|  | <https://doi.org/10.48550/arXiv.2610.40269> Focus to learn more  arXiv-issued DOI via DataCite |

## Submission history

From: Afridi Mahmud [[view email](https://arxiv.org/show-email/1cdeb1e0/2610.40269)]   
 **[v1]**
Thu, 29 Oct 2026 15:29:45 UTC (1,421 KB)

Full-text links:

## Access Paper:

View a PDF of the paper titled When Modernization Breaks Working Code: A Single-File Study of LLMs on Legacy PHP, by Afridi Mahmud and 4 other authors

- [View PDF](https://arxiv.org/pdf/2610.40269)
- [HTML (experimental)](https://arxiv.org/html/2610.40269v1)
- [TeX Source](https://arxiv.org/src/2610.40269)

[view license](http://arxiv.org/licenses/nonexclusive-distrib/1.0/ "Rights to this article")

### Additional Features

- [Audio Summary](https://arxiv.org/audio/2610.40269)

### Current browse context:

cs.SE

[< prev](https://arxiv.org/prevnext?id=2610.40269&function=prev&context=cs.SE "previous in cs.SE (accesskey p)")
  |   
[next >](https://arxiv.org/prevnext?id=2610.40269&function=next&context=cs.SE "next in cs.SE (accesskey n)")

[new](https://arxiv.org/list/cs.SE/new)
 | 
[recent](https://arxiv.org/list/cs.SE/recent)
 | [2026-10](https://arxiv.org/list/cs.SE/2026-10)

Change to browse by:

[cs](https://arxiv.org/abs/2610.40269?context=cs)

### References & Citations

- [SciX](https://scixplorer.org/abs/arXiv:2610.40269)
- [Google Scholar](https://scholar.google.com/scholar_lookup?arxiv_id=2610.40269)
- [Semantic Scholar](https://api.semanticscholar.org/arXiv:2610.40269)

export BibTeX citation
Loading...

## BibTeX formatted citation

×

loading...

Data provided by:

### Bookmark

[BibSonomy](http://www.bibsonomy.org/BibtexHandler?requTask=upload&url=https://arxiv.org/abs/2610.40269&description=When Modernization Breaks Working Code: A Single-File Study of LLMs on Legacy PHP "Bookmark on BibSonomy")
[Reddit](https://reddit.com/submit?url=https://arxiv.org/abs/2610.40269&title=When Modernization Breaks Working Code: A Single-File Study of LLMs on Legacy PHP "Bookmark on Reddit")



Bibliographic Tools

# Bibliographic and Citation Tools

Bibliographic Explorer Toggle

Bibliographic Explorer *([What is the Explorer?](https://info.arxiv.org/labs/showcase.html#arxiv-bibliographic-explorer))*

Connected Papers Toggle

Connected Papers *([What is Connected Papers?](https://www.connectedpapers.com/about))*

Litmaps Toggle

Litmaps *([What is Litmaps?](https://www.litmaps.co/))*

scite.ai Toggle

scite Smart Citations *([What are Smart Citations?](https://www.scite.ai/))*

Code, Data, Media

# Code, Data and Media Associated with this Article

alphaXiv Toggle

alphaXiv *([What is alphaXiv?](https://alphaxiv.org/))*

Links to Code Toggle

CatalyzeX Code Finder for Papers *([What is CatalyzeX?](https://www.catalyzex.com))*

DagsHub Toggle

DagsHub *([What is DagsHub?](https://dagshub.com/))*

GotitPub Toggle

Gotit.pub *([What is GotitPub?](http://gotit.pub/faq))*

Huggingface Toggle

Hugging Face *([What is Huggingface?](https://huggingface.co/huggingface))*

ScienceCast Toggle

ScienceCast *([What is ScienceCast?](https://sciencecast.org/welcome))*

Demos

# Demos

Replicate Toggle

Replicate *([What is Replicate?](https://replicate.com/docs/arxiv/about))*

Spaces Toggle

Hugging Face Spaces *([What is Spaces?](https://huggingface.co/docs/hub/spaces))*

Spaces Toggle

TXYZ.AI *([What is TXYZ.AI?](https://txyz.ai))*

Related Papers

# Recommenders and Search Tools

Link to Influence Flower

Influence Flower *([What are Influence Flowers?](https://influencemap.cmlab.dev/))*

Core recommender toggle

CORE Recommender *([What is CORE?](https://core.ac.uk/services/recommender))*

- Author
- Venue
- Institution
- Topic


About arXivLabs

# arXivLabs: experimental projects with community collaborators

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? [**Learn more about arXivLabs**](https://info.arxiv.org/labs/index.html).

[Which authors of this paper are endorsers?](https://arxiv.org/auth/show-endorsers/2610.40269) |
Disable MathJax ([What is MathJax?](https://info.arxiv.org/help/mathjax.html))
tambourine_man2214
🟧 echo.paper ⭐The paper reports that, on 100 WordPress 4.0 PHP files modernized toward PHP 8.3, each tested LLM broke 32–51 files that had passed behaviorAfridi Mahmud, Abid Hasan Khondaker, Sadif Ahmed, Md Nafiu Rahman, and Rifat Shahriyar——

Interpretation history

Decision trace