Websites11 min read

Legacy PHP app: refactor vs rewrite decision in Toronto (2026)

Mohamed Bah·Fondateur, Kolonell
October 8, 2026
Share:
Legacy PHP app: refactor vs rewrite decision in Toronto (2026)

Legacy PHP app: refactor vs rewrite decision in Toronto (2026)

Websites

The verdict in three sentences

In most cases, incremental refactoring at USD 33,000 to 88,000 (about €30,000 to €80,000) over 12 months secures an ageing PHP 5 application at far lower risk than a full rewrite at USD 99,000 to 275,000 (about €90,000 to €250,000). A rewrite is only justified if the business model has fundamentally changed or if less than 30% of the code is reusable. The status quo is the most expensive option over time: PHP 5 has received no security patches since 2019, and depending on a single developer is a business continuity risk.

The real cost of the status quo

The CIO of a Toronto distribution group runs an order management application written in PHP 5.6 twelve years ago: 180,000 lines of code, no automated tests, an in-house framework and one developer who understands how it works. Doing nothing looks free. It is not.

Risk itemCurrent situationEstimated 2026 annual cost
Hosting on an unmaintained PHP 5 serverpaid extended support or isolated serverUSD 4,400 to 9,900
Manual security patchingknown flaws not fixed upstreamUSD 6,600 to 16,500
Slow changes (3 to 5 times longer)extra development costUSD 16,500 to 44,000
Single-developer dependencyresignation, sick leave risknot quantifiable, critical
Security incident (10% to 20% yearly probability)average SME incident costUSD 55,000 to 165,000
Blocked integrations (API, payments, SSO)postponed projectslost revenue

As an order of magnitude, the status quo costs USD 27,500 to 70,000 a year in direct spending, before even counting incident risk.

Incremental refactoring or rewrite: the comparison

Incremental refactoring follows the strangler fig pattern: the application is migrated module by module to a recent PHP version and a standard framework (Laravel or Symfony), staying in production at every step. A rewrite starts from a blank page, often with a different technology.

CriterionIncremental refactoringFull rewrite
BudgetUSD 33,000 to 88,000USD 99,000 to 275,000
Duration9 to 12 months, in phases12 to 24 months
Releasescontinuous, module by modulesingle cut-over, big-bang risk
Regression risklow, covered by added testshigh (forgotten business rules)
Feature freezenooften 6 to 12 months
Technical outcomePHP 8.3, Laravel or Symfony, 60-70% test coveragenew architecture, stack of choice
Observed failure or overrun rate10% to 20%40% to 60% budget overrun

The main danger of a rewrite lies in implicit business rules: 12 years of edge cases coded without documentation. Recreating them faithfully often takes twice as long as planned.

Decision criteria

Before deciding, a 5 to 10 day audit (USD 4,400 to 9,900) measures the state of the code and the functional relevance of the application.

Criterion measured in the auditLean towards refactoringLean towards rewriting
Share of reusable codeover 50%under 30%
Fit with current businessprocesses have not changednew business model
Databaseconsistent, migratable schemainconsistent schema, duplicated data
Blocking dependenciesreplaceable one by oneabandoned PHP extension at the core
Usersinterface acceptedUX redesign essential
Available budgetunder USD 110,000over USD 165,000 and 18 months

A hybrid approach is common: refactor the core (orders, invoicing) and rewrite only the user interface as a modern front end, for an intermediate budget of USD 66,000 to 132,000.

Need a professional website?

Kolonell builds websites that attract clients, optimized for the Sénégalese market. Free quote in 2 minutes.

Prefer a call back?

Leave your WhatsApp number and a Kolonell expert will get back to you within 1 business day. Free, no strings attached.

Mini case study

Thomas, CIO of a distribution group in Toronto, commissions a 7-day audit for USD 6,900. Result: 65% of the code is reusable and the business model has not changed. He chooses a 4-phase refactoring for USD 75,000 over 11 months, against a rewrite quote of USD 203,500 over 18 months. The status quo was costing him about USD 46,000 a year (isolated hosting, patches, slowed changes). After refactoring, these costs fall to about USD 13,000 a year, a USD 33,000 annual saving. The total investment (USD 81,900) pays back in two and a half years, and two more developers can now work on a standard Laravel codebase.

FAQ

Can we simply upgrade from PHP 5 to PHP 8 without refactoring?

Rarely. Removed functions (mysql_*, ereg, each) and typing changes break a large share of old code. A version upgrade alone already costs USD 16,500 to 44,000 on a 100,000-line codebase.

How much does adding tests to an untested application cost?

Characterisation tests on critical flows (orders, invoicing, stock) cost USD 8,800 to 22,000. They are the prerequisite for any safe refactoring.

What if the only developer leaves during the project?

The project's first action is to document the architecture and critical business rules over 2 to 4 weeks, and to pair a second developer from the very first phase.

Should we switch language, for example to Node.js?

Only if the team and ecosystem justify it. PHP 8.3 with Laravel or Symfony performs well, and staying on PHP avoids rewriting 100% of the code and hiring for a different skill set.

How long will the application be unavailable?

With incremental refactoring, no planned downtime beyond 1 to 2 hour maintenance windows per phase. A rewrite requires a single cut-over, often preceded by 2 to 4 weeks of double data entry.

Let's scope your project. Send us your PHP version, code volume and critical modules: we start with a 5 to 10 day audit, then price a refactoring between USD 33,000 and 88,000 or a rewrite if it is justified. Detailed quote within 48 h. WhatsApp +221 77 596 93 33.

Tags:#legacy application#refactoring#software rewrite#PHP 5#technical debt#Toronto
Share:

Mohamed Bah

Fondateur, Kolonell

Passionate about digital and entrepreneurship in Africa, Mohamed has been helping Sénégalese businesses with their digital transformation since 2020. Founder of Kolonell, he believes every SME deserves a professional and accessible online présence.