When nobody can say what a change will break, every change gets slower, riskier and more expensive. Here's what type safety means in plain terms, why ageing PHP codebases rarely have it, and what that costs a business.
Every business with an older web application has heard some version of this from its developers: "We can change that, but we're not sure what else it will break."
It is usually said about something that sounds trivial. Add a field to the customer record. Rename an order status. Change a price from a whole number to one with decimals. The change itself takes minutes. Working out where else that value is used, and what each of those places assumes about it, can take days. So the change gets postponed, or it ships with crossed fingers and a weekend on call.
That hesitation has a real cost to the business, and much of it comes down to one property of the code: whether it states, in a way a tool can check, what kind of data each part of the system expects.
Why changing one thing can break ten others
In software, types are labels that describe what kind of data something is: this is a number, this is a piece of text, this is a customer record with an email address, this step returns either an order or nothing. A type checker is a tool that reads those labels and reports, before the software runs, every place where they don't match up.
That changes how a team works. Rename a field, run the checker, and it lists every place that still uses the old name. Change what a piece of the system expects, and every part that hasn't been updated is flagged. The tool does the searching that would otherwise rely on a developer's memory.
Without types, the same change depends on everyone remembering everything. Mistakes surface only when the software runs, often in the part nobody tested: the monthly report, the refund flow, the admin screen used twice a year.
How much does this help? The size of the benefit is debated, so here is one careful measurement. In a study presented at a major software-engineering conference in 2017, researchers from University College London and Microsoft Research sampled 400 bugs from public JavaScript projects. These were bugs that had already slipped past testing and code review. For each one, they added type labels by hand and checked whether a type checker would have caught the mistake. About 15% of the bugs were caught. The authors describe this as a conservative figure, and it leaves out other benefits, such as making code easier to navigate and understand.
Fifteen per cent is not a silver bullet, and types don't replace testing. But these are bugs that reached users, and a tool that runs in seconds could have caught them first.
What could go wrong for your business
This isn't a security flaw that an attacker can exploit from outside. It is a slower, quieter risk, and its cost shows up in other ways:
- Changes take longer and cost more. Simple requests turn into weeks of work, and estimates keep growing.
- Errors reach customers. A mistake in an untested corner of the system can break checkout, billing or reporting in production.
- Key-person dependence. The few developers who remember how everything fits together become people the business can't afford to lose.
- Lost opportunities. New features, integrations and improvements get postponed because nobody is confident about touching the code.
None of this happens overnight. It builds up, release by release, until the software starts shaping what the business can and can't do.
Could your website be next?
The question here isn't whether an attacker will find you. Automated attacks aren't the main concern with this issue. It is whether your own next change will cause a problem, and how long it will take to make.
Every business application changes: prices, tax rules, payment providers, customer data, regulations. Each change made without a safety net is a small gamble, and the odds get worse as the system grows and the people who built it move on.
Having avoided a serious failure so far doesn't mean the risk is low. It may mean the system hasn't been asked to change much yet, or that your team has been absorbing the cost through caution and extra hours. A system that feels stable because nobody touches it is a different thing from one that is safe to change.
This doesn't mean every older application is fragile. Some are well organised and well tested. But if your developers hesitate before small changes, that hesitation is worth taking seriously.
Why legacy PHP applications deserve attention
None of this is an argument that PHP can't be typed. Modern PHP has proper type labels, and tools such as PHPStan and Psalm can check PHP code before it runs. Well-run modern PHP projects use them, and they work well.
The difficulty is with what ageing PHP codebases actually look like.
Older versions can't express it. PHP 5 has no way to label a value as a number or a piece of text. PHP 7.0, released in December 2015, added that ability, and later versions filled in more gaps. According to W3Techs, 7.7% of websites using PHP were still on PHP 5 as of 23 October 2026, and 26.9% on PHP 7. Even on newer versions, code written years ago rarely went back and added labels.
PHP checks loosely by default. PHP checks its type labels while the software runs, not before, and by default it quietly converts values where it can rather than refusing them. A stricter mode exists, but it is switched on file by file, so a codebase can be strict in one place and lenient in the next.
Data travels without a description. Older PHP applications commonly pass records around in loose structures whose contents exist only by convention. A tool can't check what was never described.
Adding checks to old code is itself risky. Switching on stricter checking in a large legacy codebase typically produces a long list of errors, each one a place where the code relied on lenient behaviour. Fixing them changes behaviour in code that often has no tests, which brings back the very fear the checks were meant to remove.
The browser is a separate world. In a typical PHP application, the server and the browser are written in different languages, so nothing checks that they agree about the data passing between them.
This is how technical debt accumulates: not as one dramatic failure, but as a codebase that gets slower and more expensive to change every year.
What this means for your organisation
A useful test is to ask your team one question: "If we renamed a field on our main customer or order record, how would you find every place that breaks?" If the answer is a text search and manual testing, you have this problem.
It is also worth knowing which PHP version your application runs, and how much of the code could be checked automatically today. Those answers tell you whether improving the current system is realistic, or whether a larger change deserves consideration. Either way, it is better to understand the condition of your application before an urgent business change exposes it.
Recommended next step
If your developers hesitate before small changes, find out why before it holds back something important. Our free Legacy PHP assessment looks at your PHP version, how much of your code is typed or checkable today, and where data passes between parts of the system without any checks.
Then talk to our team about what the findings mean for you. If the codebase is on modern PHP and in reasonable shape, gradually adding type checking in place is a sound, cheaper path, and we'll say so. If it is on an old version or the gaps are large, it may make sense to compare that effort with moving, piece by piece, to a stack such as Node.js with TypeScript, where type checking can cover both server and browser. Types don't remove the need for testing or for checking data that arrives from outside, so this is not a guarantee. What it can offer is a system your team can change with confidence.
Free Legacy PHP Risk Assessment
We'll review your PHP version, how much of your code is typed or checkable today, and where untyped data crosses between systems, and tell you plainly what it would take to change the code with confidence, whether that's adding types in place or planning a migration.




