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

13 points by tambourine_man

Pasting legacy PHP code into a large language model (LLM) for modernization may not yield better results than keeping the original code, according to a study evaluating five LLMs on 100 WordPress 4.0 files. The modernization attempts were assessed using 630 hidden behavioral checks and 511 Rector-detected findings, revealing that the outputs often failed to preserve the original code’s functionality. The study suggests caution when using LLMs for code modernization without project context or execution feedback.

Read the article

Discussion on Hacker News