When Modernization Breaks Working Code: A Single-File Study of LLMs on Legacy PHP
Summary
The paper studies applying large language models to modernize legacy PHP code and how often such modernization preserves behavior. Across five LLMs and 100 WordPress PHP files, the study finds that most automated changes are unnecessary or harmful, with few improvements under PHP 8.3 and substantial regression in working code. It argues for evaluating modernization against a no-change baseline and separating modernization from behavioral preservation.