PHP powers a massive chunk of the internet and has been doing so for over three decades. Most developers use it daily without knowing its backstory, its quirks, or the surprising places it shows up. Here are the facts worth knowing.
1. PHP Was Never Meant to Be a Programming Language
PHP was created in 1994 by Rasmus Lerdorf — not to build a language, but to track visitors on his personal homepage. He wrote a handful of CGI scripts in C and called the collection "Personal Home Page Tools". That's where the name PHP came from.
It was never designed. It grew organically out of necessity. Lerdorf himself has said publicly:
"I don't know how to stop it, there was never any intent to write a programming language."
What started as a visitor counter eventually became the language running a third of the internet.
2. PHP No Longer Stands for What It Used to
The original meaning was Personal Home Page. As the language grew into something far beyond personal pages, the name was officially rebranded to a recursive acronym:
PHP: Hypertext Preprocessor
A recursive acronym means the abbreviation references itself in its own expansion — PHP stands for PHP Hypertext Preprocessor. It's a tradition in the programming world, borrowing from GNU (GNU's Not Unix).
3. WordPress, Facebook, and Wikipedia All Run on PHP
Some of the most visited websites in the world were built on PHP:
- WordPress — powers over 43% of all websites on the internet, written entirely in PHP
- Facebook — was built on PHP and still uses a heavily modified version today
- Wikipedia — runs on MediaWiki, a PHP application
- Slack — originally built with PHP on the backend
Facebook's usage grew so large that they built HipHop for PHP (HPHPc), a transpiler that converted PHP to C++ for performance. They later built HHVM (HipHop Virtual Machine) as a full PHP runtime alternative.
4. Facebook Built Their Own PHP Compiler
Standard PHP wasn't fast enough for Facebook's scale. So they built HHVM — a JIT-compiled runtime for PHP that dramatically improved execution speed. They also created Hack, a PHP-derived language with strict static typing, which Facebook's codebase runs on today.
The fact that a company at Facebook's scale invested that heavily in PHP infrastructure instead of rewriting everything is a testament to how deeply PHP was embedded in their systems.
5. PHP 6 Never Existed
PHP's version history goes:
PHP 5 → PHP 7 → PHP 8
PHP 6 was an ambitious project started around 2005 with a primary goal of native Unicode support. The project ran for years, faced enormous technical challenges with Unicode string handling, and was eventually abandoned in 2010.
So much of the PHP 6 work that was actually completed got backported into PHP 5.3 instead. The version number 6 was permanently skipped to avoid confusion with all the documentation, books, and articles that had already been written about the abandoned PHP 6 features.
6. PHP 7 Was a Massive Performance Leap
When PHP 7 released in December 2015, it wasn't just an incremental update. Benchmarks showed:
- 2x faster than PHP 5.6 on most workloads
- 50% lower memory consumption
- Performance comparable to HHVM in many scenarios
This came from a complete internal rewrite of PHP's data structures and execution engine called phpng (PHP Next Generation). PHP 7 made a lot of "PHP is slow" arguments obsolete overnight.
7. PHP 8 Introduced a JIT Compiler
PHP 8.0 released in November 2020 and brought a Just-In-Time (JIT) compiler to PHP for the first time. JIT compiles code to native machine instructions at runtime instead of interpreting bytecode — the same concept that makes modern JavaScript engines fast.
PHP 8 also introduced:
- Named arguments —
array_slice(array: $arr, offset: 1) - Match expressions — a stricter, cleaner switch
- Nullsafe operator —
$user?->getAddress()?->getCity() - Union types —
function foo(int|string $value) - Attributes — native annotation syntax replacing PHPDoc
PHP 8 was arguably the most significant modernization of the language since PHP 5.
8. PHP Has a Type System — It Just Doesn't Force You to Use It
PHP started as a loosely typed language where variables had no declared types. But since PHP 7, a full type system has been progressively added:
<?php
declare(strict_types=1);
function calculateTotal(int $quantity, float $price): float
{
return $quantity * $price;
}
With declare(strict_types=1) at the top of a file, PHP enforces types strictly — passing the wrong type throws a TypeError. Without it, PHP coerces types silently.
PHP 8.x continues expanding the type system with intersection types, enum types, readonly properties, and never return types. Modern PHP code can be as strictly typed as TypeScript if you choose to write it that way.
9. The $ Variable Syntax Comes From Perl
PHP borrowed heavily from Perl in its early days, including the $ prefix for all variables. Perl was the dominant server-side scripting language when PHP was being built, and Rasmus Lerdorf was familiar with it.
$name = "Gagan";
$age = 25;
$isActive = true;
Every variable in PHP regardless of type uses $. It's one of the most immediately recognizable things about PHP syntax and it comes directly from Perl's influence.
10. PHP Has a Built-In Web Server
Since PHP 5.4, PHP ships with a built-in development web server — no Apache or Nginx needed for local development:
php -S localhost:8000
Point it at a directory and it serves files immediately. Laravel's php artisan serve command uses this exact built-in server under the hood.
It's not meant for production — it's single-threaded and handles one request at a time — but for local development and quick prototyping it's perfectly capable.
11. echo is Not a Function
This catches a lot of developers off guard. echo in PHP is a language construct, not a function:
echo "Hello";
echo("Hello");
Both work, but echo doesn't have a return value and can't be used as an expression. This is why you can't do:
$result = echo "Hello";
Same applies to print, isset, unset, list, array, and require — all language constructs, not functions, even though some of them look exactly like function calls.
12. PHP Arrays Are Actually Ordered Hash Maps
In most languages, arrays and hash maps (dictionaries/objects) are completely separate data structures. In PHP, there is only one data structure — the array — and it handles both:
$indexed = [1, 2, 3];
$associative = [
'name' => 'Gagan',
'role' => 'developer',
];
$mixed = [
0 => 'first',
'key' => 'value',
1 => 'second',
];
Under the hood, every PHP array is an ordered hash map that maintains insertion order. This is different from JavaScript objects (which lost order in older specs) and Python dicts (which only guaranteed order from Python 3.7). PHP arrays have always maintained order, always.
13. Composer Changed PHP Development Completely
Before Composer launched in 2012, PHP had no standard dependency manager. Developers manually downloaded libraries, managed include paths, and dealt with version conflicts by hand. PEAR existed but was notoriously difficult to use.
Composer brought semantic versioning, a central package repository (Packagist), autoloading via PSR-4, and proper dependency resolution to PHP. It's the single biggest tooling improvement in PHP's history. Modern PHP development — Laravel, Symfony, everything — is completely built on top of Composer.
14. PHP Runs on 78% of Websites With a Known Server-Side Language
According to W3Techs data, PHP is used by 78.1% of all websites whose server-side language is known. The next closest is ASP.NET at around 6%. No other server-side language is even close in terms of deployment footprint.
This isn't because PHP is the best language by every metric — it's because it's been around long enough, is easy to host, and powers WordPress, which alone accounts for a huge portion of that number.
15. PHP's Mascot is an Elephant Named ElePHPant
Since 2007, PHP's official mascot has been the ElePHPant — a blue elephant with the PHP logo on its side. It was designed by Vincent Pontier.
The name is a portmanteau of elephant and PHP. Physical plush ElePHPant toys have been produced in multiple colors over the years and are considered collector's items in the PHP community. Different colors were produced for specific conferences, companies, and framework communities — Laravel has its own red version, Symfony has its own, and so on.
The Bottom Line
PHP has a strange history — born as a personal project, abandoned more than once, declared dead repeatedly, and yet still running the majority of the web three decades later. It's been through bad API design decisions, a cancelled major version, a complete internal rewrite, and a JIT revolution. Understanding where it came from and how it evolved makes you a better PHP developer — because a lot of the language's quirks make complete sense once you know the story behind them.