Legacy code modernisation

Modernize legacy PHP code with the help of an expert

Taming legacy PHP code

Many development teams struggle to keep developing a PHP application that was built years ago. Updating the code to a modern PHP version or a recent framework can seem like an impossible task. With the right approach, you can regain control of your codebase.

Increase velocity

Legacy code often slows down the development of new features. With a current PHP version and automated tests, you make changes faster and with more confidence, so you can respond better to changes in the market and the needs of your customers.

Minimize risks

A PHP upgrade or framework migration is time-consuming and risky. If not done correctly, you can introduce bugs or get completely stuck. Together we will determine the best strategy to follow.

Modernizing legacy PHP code

Many PHP applications still run on an old PHP version, a custom framework or an outdated version of Symfony or Laravel. Such legacy software has often been in use for years and is hard to understand, which makes adding new features or changing existing code a slow process. Automated tests are usually missing, so every change carries a risk of introducing new bugs.

I guide your development team through modernizing the code. The team does the work itself; I help determine the approach and make sure the team can continue the modernization on its own afterwards.

Why modernize your PHP application?

Every PHP version receives four years of support: two years of bug fixes, followed by two years of security updates only. PHP 8.1 and older no longer receive updates, and support for PHP 8.2 ends on December 31, 2026. If a vulnerability in PHP is found after that, your application stays vulnerable to it.

An old PHP version also holds back the rest of your application. New versions of Symfony, Laravel and other packages require a recent PHP version, so you can no longer install security updates and improvements to those packages either. The longer you wait, the bigger the jump to a current version becomes.

Rebuild or modernize step by step

Rebuilding an application from scratch often seems like the fastest route to clean code, but it is risky and expensive. The existing application contains years of business logic and edge cases that aren't documented anywhere, and in a rebuild you have to rediscover all of them. Until the new version is finished, you maintain two applications, and you often can't add new features to the old one.

In most cases, it is better to modernize the existing code step by step. The application keeps running and your team can keep shipping new features. Every step delivers value right away, and if priorities change, you can pause in between without leaving work half done. A rebuild can be the right choice, though, for example when the application is small or when most of its functionality needs to change.

How I approach it

  1. Map the current state. First we map out which PHP and framework version is running, which dependencies are outdated and where the biggest risks are. An application audit is a good starting point for this.
  2. Build a safety net. Before making major changes, the team adds automated tests to the most important parts of the application, and we set up static analysis (such as PHPStan) and continuous integration. That way you see right away when a change breaks something.
  3. Upgrade in small steps. The team updates the PHP version, the framework and the dependencies step by step. With tools like Rector we apply a large part of the changes automatically, so the team can focus on what needs to be done by hand.
  4. Continue independently. I work alongside the team through pair programming and code reviews, and explain why we make certain choices. That way the team can gradually take over the modernization on its own.
PHP logo
Symfony logo
Laravel logo

Get in touch

Nic Wortel, software consultant

Is your team struggling with legacy PHP code? Get in touch with Nic to discuss the possibilities.