Papers for

php developers

Papers whose findings have a practical use for this group, as judged from the abstract. Open a paper to read what it means in practice.

Dependency selection affects PHP migration test outcomes and benchmarks

Yesterday's Code, Today's Dependencies: How Dependency Selection Shapes PHP Migration Benchmarks

Abstract: Migration benchmarks need projects whose tests pass before migration begins. Yet an old project can behave differently without any change to its code. Reinstalling it today may introduce newer libraries, changing both its initial test results and the failures observed during migration. We investigate this effect in PHP 7.4-to-8.3 migration. Using unchanged project source and saved package records, we compare two dependency policies. Modern selection allows all versions in the snapshot, while release-date selection allows only versions published by the project's release date. With Composer 2 fixed, release-date selection improves the PHP 7.4 pass rate by 7.1 pp across 3,660 releases. A separate comparison against committed locks shows that it also recovers recorded dependency versions more closely than modern selection. The choice matters after migration as well. Among projects that pass on PHP 7.4 under both policies, PHP 8.3 test outcomes differ in 15.0% of eligible pairs. We use a shared test runner and bypass Composer's platform check to isolate test behavior. The resulting candidate migration task sets overlap by only 58.5%. Most differences arise in Laravel projects, where older dependencies trigger deprecations that newer versions avoid. Targeted interventions show that removing these initial failures can restore passing tests or expose further incompatibilities. Thus, dependency selection changes not just whether an old project passes, but also which migration failures a benchmark can observe. Preserved locks provide the strongest available version reference; without them, release-date selection offers a historically grounded alternative. Migration benchmarks should make this choice explicit and report its effect on their results.

Fri 30 OctSoftware Engineering
The gist
When upgrading old PHP projects to newer versions, the libraries the project depends on can change over time, even if the project’s code doesn’t. The authors studied how choosing different library versions affects whether tests pass before and after upgrading from PHP 7.4 to 8.3. They found that using libraries released before the project’s original release date leads to more consistent test results and better reflects historical versions. This choice impacts not only whether the project passes tests but also which kinds of test failures appear during migration.
Open → 2610.41263v1

Modernizing legacy PHP code with AI often breaks working programs

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

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.

Thu 29 OctSoftware Engineering
The gist
The authors studied whether using large language models (LLMs) to update old PHP code works better than leaving the code unchanged. They found that these AI models often broke code that was working fine before, while fixing very few problems. A rule-based tool called Rector caused fewer errors and fixed a few more issues than the AI models. The researchers suggest that evaluations should always compare against not changing the code, and separately measure updates and safety.
Open → 2610.40269v1