FAQ
Why do we need to migrate our system?
The reason to move off PHP lies in where the language came from and how it grew
- The reason to move is not that PHP is inferior. Old versions, and code written in old styles, tend to keep patterns that lead to incidents.
- If the code follows current practice, upgrading to a recent PHP version is enough.
- If old coding styles remain widely, or the nature of the system has changed, we recommend moving to a technology that fits that nature.
Published:
01 / INTRODUCTION
This is not about which language is better
People often say that PHP is dangerous. But this is not about which language is better.
Every language has a purpose it was made for and a way it spread: its origin and its upbringing. From these come incident patterns that are specific to that language. Once you know PHP's patterns, the reason to move and the place to move to become clear.
The cause lies in the history of the language. It does not lie with the people who wrote the code.
02 / HISTORY
PHP's origin and upbringing
| When | What happened | Source |
|---|---|---|
| 1994 | Rasmus Lerdorf created it to track visits to his online résumé. It was a set of CGI tools written in C (CGI is a way for a web server to call a program), named “Personal Home Page Tools”. | S1 |
| June 1995 | The source code was released to the public. | S1 |
| PHP 5.4 | register_globals (a setting that turns URL values directly into variables) and magic quotes (a setting that automatically adds \ to input) were removed. | S2 |
| PHP 7.4 | allow_url_include (a setting that lets a file at an external URL be loaded as program code) was deprecated. | S3 |
| PHP 8.0 | The rules for loose comparison (==) between strings and numbers changed. A string that is not in numeric form is no longer converted to a number; it is compared as a string. | S4 |
PHP was born as a tool for individuals to add dynamic parts to HTML. It was not built on the assumption of large business systems or confidential data.
PHP grew up on ease of use. It spread by keeping its settings loose so that anyone could get it running right away. The settings in the table above were added for that ease of use, and were removed after they turned out to be dangerous.
Removing them took many years. Code written during those years is still running today.
03 / TODAY
PHP today
| Fact | Figure | Source |
|---|---|---|
| Share of websites using PHP, among websites whose server-side language is known | 67.8% (as of December 1, 2026) | S5 |
| Share of PHP 8, among websites using PHP | 70.0% (as of December 1, 2026) | S6 |
From the second figure, we can read that about 30% of websites using PHP run on PHP 7 or earlier (100 minus 70.0).
Security fixes for PHP 7 and earlier have already ended. You can check the end date for each version on the compatibility page.
Today's PHP (version 8) has fixed many of the dangerous defaults. What tends to lead to incidents is old versions and code written in old styles. It is not the PHP language itself.
One reason PHP has a large number of vulnerabilities (weaknesses that attackers use) is that many sites use it and a wide range of people write it. The nature of the language alone does not determine the count.
04 / PATTERNS
Patterns that tend to remain in old PHP code
| Pattern | What happens | How it relates to origin and upbringing |
|---|---|---|
| Writing output as is | Characters that a user entered run as a script on the page (XSS: cross-site scripting). | PHP was born as a tool for embedding values in HTML. Escaping (replacing symbols with harmless characters) was the writer's job. |
| Building SQL by joining strings | Input runs as part of the SQL (the command sent to the database). This is SQL injection. | An easy way of connecting to a database became widespread. |
| Loading a file named by a value from outside | An unintended file, or external code, runs. | include (the statement that loads another file) was easy to use, and there was a setting that allowed external URLs too. S3 |
| Relying on loose comparison | Different values are judged to be equal. | The rule was made to suit the web, where all input is a string. S4 |
Calling unserialize on data from outside | Code runs from input that was meant to be data (deserialization: turning data in a stored form back into its form inside the program). | This pattern is seen across languages, not only in PHP. S9 |
A version upgrade fixes only the patterns that come from settings and language rules (rows 3 and 4 of the table).
The patterns that come from coding style (rows 1, 2 and 5 of the table) remain after a version upgrade. The code itself has to be fixed.
05 / OTHER LANGUAGES
Other languages have their own patterns too
This is not only about PHP. The table below is ordered by the era each language was born in. It is not a ranking.
| Language | Origin and upbringing | Typical patterns that come from them | Source |
|---|---|---|---|
| C / C++ | Languages for writing operating systems. Memory checks are left to the writer. | Memory handling errors. Chromium (the browser that Chrome is based on) states that about 70% of its high-severity security bugs are memory safety problems. | S7 |
| PHP | Born as a tool for personal home pages. | As described in “Patterns that tend to remain in old PHP code” on this page. | S1 S2 S3 S4 |
| JavaScript | In 1995, the first prototype was built in about 10 days as a language for the browser. | Prototype pollution (the shared parent of objects being rewritten). | S8 S10 |
| Java | It started as a language for consumer electronics. Today it is widely used in enterprise business systems. | It has many mechanisms that swap things in at run time, and these become footholds. Log4j (CVE-2021-44228), the Struts expression language (CVE-2017-5638), and deserialization. | S9 S11 S12 S13 |
| Ruby on Rails | It put ease of writing, and doing things for you automatically, first. | Mass assignment (a feature that saves input fields together, through which unintended fields can be rewritten; the 2012 GitHub incident) and automatic conversion of input (CVE-2013-0156). | S14 S15 |
| Python | A general-purpose scripting language. | pickle (reading untrusted data runs code). | S16 |
| C# / .NET | In a position close to Java's. | BinaryFormatter (removed in .NET 9 because it cannot be made secure). | S17 |
| VBA (Office macros) | A language for automating office documents. | Opening a document runs code. Office for Windows now blocks macros in files from the internet by default. | S18 |
| Rust | A language that checks memory safety through ownership (rules that decide who holds each piece of memory). | The language prevents memory handling errors at compile time (when the program is converted into a form that can run). It cannot prevent errors in business rules. | S19 |
What is common across languages is the pattern where something passed as data runs as code. The differences between languages are differences in where that hole is open.
06 / UPGRADE OR MIGRATE
Upgrade the version, or move
There are two options: upgrade the version, or move to a technology whose origin fits the nature of the system. This does not mean that you must always move off PHP.
| The state of your system | What we recommend |
|---|---|
| Only the version is old, and the code follows current practice (it uses a framework (a set of parts that forms the base for development), passes values to SQL separately, and escapes output) | Upgrade to a recent PHP version (8.4 or 8.5), as listed under “Recommended migration targets” on the compatibility page. |
| Old coding styles remain widely (the patterns above are present). Even a version upgrade requires fixing the places that use removed features | Since the code has to be rewritten anyway, take the chance to choose the destination again (see the next section). |
| The nature of the system has changed: for example, it now handles confidential data such as customer information, or its business processing has grown | Move to a technology whose origin fits the nature of the system (see the next section). |
07 / WHERE TO GO
What to move to: match the nature of the system with the origin of the technology
If you move, as of December 2026 the safe choices are Rust for public websites and Spring Boot (a Java framework) for business systems.
| Nature of the system | Direction to move in | How it relates to origin and upbringing |
|---|---|---|
| Public websites (sites with a small amount of member login, simple e-commerce; the users are the general public; load can rise suddenly) | Rust on the server. Build the screens with React or similar, and deploy the built output. | The language prevents memory handling errors. What you place on the public side can be kept small, and you are less likely to be chased by end-of-life dates of a runtime (the base software that runs the program). |
| Business systems (used by employees and business partners; with reports, batch jobs (processing done in bulk), complex transactions (a mechanism that makes a series of operations succeed or fail together), and fine-grained permissions) | Spring Boot (Java) on the server. | It is widely used in enterprise business systems. Parts such as authentication and transactions are available, and many people can maintain it. |
You can tell which applies as follows. Go from the top, and decide by the first one that applies.
| # | Question | If it applies |
|---|---|---|
| 1 | The system needs any of: reports, batch jobs, complex transactions, or fine-grained permissions | Spring Boot |
| 2 | The main users are a fixed group of people (employees and business partners) | Spring Boot |
| 3 | It is a public website, and its business processing is about the level of members, cart, orders and inquiries | Rust |
| 4 | None of the above applies | Spring Boot |
Whichever you choose, the structure is the same.
- Divide the system into three tiers: screens, server and database.
- Put authentication, input validation, business rules and transactions in the server tier. Do not put them in the screen framework.
- Leave card information with a payment service provider.
There are two points to keep in mind.
- Moving does not mean that incidents stop happening. Java has its own patterns too. Version management continues at the destination.
- We present Rust and Spring Boot as the safe choices as of December 2026.
08 / OUR SERVICE
Talk to us about migration
Compatibility and recommended migration targetsAnswer a few questions to see indicative duration and costContact us
REF / SOURCES
Sources
- S1PHP Manual — History of PHP
- S2PHP 5.4.0 Release Announcement
- S3PHP RFC: Deprecations for PHP 7.4
- S4PHP RFC: Saner string to number comparisons
- S5W3Techs — Usage statistics of PHP for websites
- S6W3Techs — Historical trends in the usage of PHP versions
- S7The Chromium Projects — Memory safety
- S8OWASP Cheat Sheet Series — Prototype Pollution Prevention
- S9OWASP Cheat Sheet Series — Deserialization
- S10Speaking JavaScript — Chapter 4. How JavaScript Was Created
- S11NVD — CVE-2021-44228
- S12NVD — CVE-2017-5638
- S13The Java Language Specification — Preface to the First Edition
- S14The GitHub Blog — Public Key Security Vulnerability and Mitigation
- S15CERT/CC — Vulnerability Note VU#380039
- S16Python Documentation — pickle
- S17Microsoft Learn — In-box BinaryFormatter implementation removed and always throws
- S18Microsoft Learn — Macros from the internet are blocked by default in Office
- S19Rust Programming Language
Start with your system.
Discuss your requirements and the support you need.