The short version

When someone asks "how much work is it to upgrade this old Laravel app", the answer almost always comes back as one big number. Nobody separates the two very different halves of the job: the language layer (PHP syntax and removed functions) and the framework layer (facades, contracts, config keys, scheduler methods).

I picked 3 real, unmaintained open-source Laravel projects and ran a static check against PHP 8.0 on all of them with the same tool and the same flags.

repo framework stars last commit PHP files hits
mylxsw/wizard 5.8 2267 2023-03 194 1
Vuedo/vuedo 5.2 2262 2020-10 102 0
drehimself/laravel-ecommerce-example 6.0 1018 2023-01 168 3

464 files, 4 hits. After reading every hit by hand, exactly one of them is a real language-layer blocker: a call to money_format(), a function that was removed in PHP 8.0. The other 2 hits are the same false positive, reproduced across projects.

That is not what most people expect. The thing that actually stops an old Laravel app from running on PHP 8 is not each(), not PHP 4 style constructors — it is the framework layer, and a static check cannot see any of it.

What the tool does

The CLI is aliu-zhongzheng/laravel-compat, MIT, on Packagist. It writes no rules of its own. All the actual checking is delegated to PHPCompatibility, invoked through PHP_CodeSniffer. The CLI only does three things: aggregate the results, assign severity, and render a report a human can read.

One command:

vendor/bin/scan ./app --php=8.0 

It produces two artifacts: build/phpcs.json (machine-readable raw output) and build/report.md (a readable Chinese report).

All three repos used the same exclusions: vendor/, node_modules/, storage/, bootstrap/cache/, *_ide_helper*.php, *.blade.php.

The first four are dependencies and runtime artifacts — not the project's own code. _ide_helper.php is generated by IDE helpers, so scanning it means scanning someone else's docblocks.

*.blade.php is worth a paragraph, because it was my first real mistake. PHP_CodeSniffer selects files by extension, so blade templates get treated as PHP files with no code in them, and every one of them raises Internal.NoCodeFound. On a real 267-file project, that single exclusion dropped the reported file count to 264, cut the hits from 6 to 3, and shortened the run from 5.382s to 4.855s — all of it noise removed.

Here is what the generated report looks like (sample project, 264 files — not one of the three above):

Generated report

Sample output with labels translated into English for this post. The CLI currently emits Chinese only; an English locale is not implemented yet.

The three repos

Vuedo/vuedo (Laravel 5.2, 2262 stars, abandoned since Oct 2020)

102 PHP files, zero hits.

That zero has to be read precisely. It means there is no language-level leftover that PHP 8.0 would break outright: no each(), no create_function(), no reversed implode(), no PHP 4 style constructors. It does not mean this app can run on PHP 8. Laravel 5.2 will not boot on PHP 8, and the reasons are almost entirely in the framework layer, where this tool sees nothing.

mylxsw/wizard (Laravel 5.8, 2267 stars, abandoned since Mar 2023)

194 PHP files, 1 hit — and it is a false positive.

The hit is in routes/console.php: a closure uses $this. The rule says a closure outside a class should not have $this, but Laravel's Artisan::command binds the closure to a command instance, so $this is perfectly legal there. This false positive reproduces across projects: two of the three repos have it, at exactly the same path, because it is Laravel's own skeleton file.

drehimself/laravel-ecommerce-example (Laravel 6.0, 1018 stars)

168 PHP files, 3 hits, 2 of them real — both on the same function:

  • app/Product.php:42 — money_format(...)
  • app/helpers.php:7 — money_format(...)

money_format() was deprecated in PHP 7.4 and removed in PHP 8.0. The official references are the "Backward incompatible changes" section of the PHP 8.0 migration guide, and the removal notice at the top of the function page: https://www.php.net/manual/en/function.money-format.php

On PHP 8.0 this is not a warning, it is a fatal error: the function does not exist. It is the only real language-layer blocker across all three repos, and the repair surface is small — swap it for NumberFormatter::formatCurrency() at those two call sites.

What this tool cannot tell you

This section matters more than the results, because it decides whether the results can be used as a basis for anything.

It does not check the framework layer. Facade aliases, contract signatures, scheduler methods, renamed config keys — the bulk of the work in a 5.2/5.8/6.0 to 8.x upgrade lives there, and the tool sees none of it. Every report states this in its scope line.

Its false positive rate is not low. 4 hits across 3 projects, 2 of them the same class of false positive. With a sample of 4, that ratio means nothing statistically, but it does mean one thing: the output is not a to-do list you can hand off unread.

Zero hits does not mean upgradable. It only rules out one dimension, the PHP language layer. Everything that remains still has to be walked through the framework's own upgrade guide, item by item.

The sample is too small. 3 repos and 4 hits is enough to say "the language layer of these projects is usually fairly clean". It is not enough to claim any ratio.

What the report is actually good for

If you read it as "tell me whether to upgrade", it does not qualify — half the answer is missing.

Its only defensible use is the opposite one: before touching the framework layer, get the language layer clean, and put "the language layer is clean" into a deliverable. What a client or a reviewer wants is not a dump of phpcs JSON. It is a report that says which dimension was checked and which one was not — that is harder to produce than raw output, and far more useful.

If your results differ

If you run this on your own project and get something different — especially a false positive, or a PHP 8.0 breakage I missed — open an issue in the repo with a minimal reproducible directory structure and the report output, and I will fold the rule or the exclusion into the defaults. If you would rather not sign up for GitHub, describing the project in the comments (framework version, file count, what it hit) counts too.

Two known false positives so far: a closure using $this inside routes/console.php (because Artisan::command binds the closure, which a static check cannot see), and generated files like _ide_helper.php being treated as source. Both are now excluded or annotated by default — but there are certainly ones I have not run into yet.

If English report output is what you actually need, say so in the comments. It is a small change, but I have not prioritized it because there were no users to ask.

Repo: https://github.com/Aliu-zhongzheng/laravel-compat
Package: https://packagist.org/packages/aliu-zhongzheng/laravel-compat
Raw reports and case notes: https://github.com/Aliu-zhongzheng/laravel-compat/tree/master/docs/cases