PHP — Still Running the Internet
Learn why PHP powers 40% of the web — WordPress, Laravel, and the legacy codebase reality that every developer should understand.
Use the lesson prompt before you improvise
This lesson already contains a scoped prompt. Copy it first, replace the task and file paths with your real context, and make the agent stop after one reviewable change.
Matching prompts nearby
29
When you finish this lesson prompt, use the related prompt set to keep the same supervision pattern on the next task.
Learn why PHP powers 40% of the web — WordPress, Laravel, and the legacy codebase reality that every developer should understand.
"Help me understand this PHP or WordPress system pragmatically.
1. Tell me whether I am looking at Laravel, WordPress, or custom legacy PHP
2. Explain the overall architecture and where I should start reading
3. Map the main concepts to frameworks and tools I already know
4. Call out version, plugin, security, and maintenance risks
5. Stop before recommending a rewrite unless the current system is truly unsafe or ...PHP is the Rodney Dangerfield of programming languages — it gets no respect. Developers mock it at conferences. Twitter threads roast its quirks. Computer science students dismiss it as a relic.
And yet PHP powers approximately 40% of all websites on the internet. WordPress alone — built on PHP — runs about 43% of all websites. Facebook was originally built on PHP (and later transitioned to Hack, a PHP-derived language). Wikipedia runs on PHP. Etsy, Slack's backend originally, Mailchimp — PHP.
You don't have to love PHP. But you should understand why it's everywhere, what modern PHP looks like, and why you'll almost certainly encounter it in your career.
Why PHP Won the Early Web
PHP's dominance isn't an accident. In the early 2000s, PHP had a killer combination:
Low barrier to entry. You could write PHP inline with HTML. No build step, no compilation, no framework required. Upload a .php file to a shared hosting account for $5/month and you had a dynamic website.
Shared hosting ubiquity. Every web host supported PHP. Not Node.js. Not Python. Not Java. PHP and MySQL were the standard LAMP stack (Linux, Apache, MySQL, PHP) that powered the affordable web.
WordPress. The most successful open-source project in web history is built on PHP. When WordPress became the default choice for blogs, business sites, and eventually e-commerce, PHP came along for the ride.
That installed base doesn't disappear. Those millions of WordPress sites still run. Those enterprise applications still work. The PHP ecosystem evolved with them.
Modern PHP — Not Your Father's Language
If your mental image of PHP is spaghetti code in a single file with SQL queries inline — that was 2005. Modern PHP (version 8.3+) is a genuine, mature language:
// Modern PHP with types, enums, and named arguments
enum OrderStatus: string {
case Pending = 'pending';
case Processing = 'processing';
case Shipped = 'shipped';
case Delivered = 'delivered';
}
class Order {
public function __construct(
public readonly int $id,
public readonly string $customerEmail,
public readonly float $total,
public readonly OrderStatus $status = OrderStatus::Pending,
) {}
public function ship(): self {
return new self(
id: $this->id,
customerEmail: $this->customerEmail,
total: $this->total,
status: OrderStatus::Shipped,
);
}
}Modern PHP has:
- Strong typing with union types, intersection types, and enums
- Readonly properties and promoted constructor parameters
- Fiber-based concurrency (async capabilities)
- Attributes (similar to decorators/annotations)
- Match expressions (like switch but better)
- Arrow functions and first-class callables
It's not JavaScript or Python, but it's a far cry from the spaghetti code reputation.
Laravel — The Modern PHP Framework
Laravel is the framework that proved PHP could be elegant. It's to PHP what Rails is to Ruby or Django is to Python — an opinionated, full-featured framework with beautiful syntax:
// Laravel route definition
Route::get('/api/products', function () {
return Product::where('is_active', true)
->orderBy('created_at', 'desc')
->paginate(20);
});
// Laravel controller
class ProductController extends Controller
{
public function store(Request $request)
{
$validated = $request->validate([
'name' => 'required|string|max:255',
'price' => 'required|numeric|min:0',
'description' => 'nullable|string',
]);
$product = Product::create($validated);
return response()->json($product, 201);
}
}Laravel includes an ORM (Eloquent), authentication, job queues, email, caching, testing, and deployment tooling. It's a complete platform for building web applications.
Laravel also has a vibrant ecosystem:
- Laravel Forge — Server provisioning and deployment
- Laravel Vapor — Serverless deployment on AWS
- Laravel Livewire — Reactive UI without JavaScript (similar to Blazor)
- Inertia.js — Laravel backend + React/Vue frontend
WordPress — The Elephant in the Room
WordPress is the most important PHP project because of its sheer scale. Understanding WordPress matters even if you never write PHP because:
Clients ask for it. "Can you build me a website?" often means "Can you set up WordPress for me?" Freelancers and agencies deal with WordPress constantly.
It's a CMS standard. Content management, e-commerce (WooCommerce), membership sites, learning platforms — WordPress has plugins for everything.
It's a job category. "WordPress developer" is a distinct career path with its own conferences, communities, and salary ranges.
Headless WordPress is increasingly popular — using WordPress as a backend CMS with a React/Next.js frontend consuming its REST API or GraphQL endpoint (via WPGraphQL). This lets you get the content management benefits of WordPress with the frontend flexibility of modern JavaScript:
// Fetching WordPress posts from a Next.js app
const posts = await fetch(
'https://your-wp-site.com/wp-json/wp/v2/posts?per_page=10'
).then(r => r.json());The Legacy Codebase Reality
Here's the career truth that nobody mentions in bootcamps: a significant percentage of professional software development involves working with existing codebases, not building new ones. And a significant percentage of those existing codebases are PHP.
Companies with PHP applications need developers who can:
- Maintain and extend existing features
- Fix bugs and security issues
- Gradually modernize the codebase
- Integrate old systems with new ones
This isn't glamorous work, but it's steady, well-paid work. And your AI agent is excellent at helping you navigate unfamiliar codebases:
I've been asked to fix a bug in a PHP Laravel application.
I primarily know JavaScript/TypeScript. Help me understand
this controller and the Eloquent ORM queries it uses.
[paste PHP code]PHP in the Modern Ecosystem
PHP isn't just legacy. The modern PHP ecosystem is active and innovative:
Composer — PHP's package manager (like npm). The ecosystem has hundreds of thousands of packages.
PHPStan/Psalm — Static analysis tools that catch bugs without running the code (like TypeScript's type checking).
Pest — A modern testing framework with elegant syntax.
Swoole/RoadRunner — High-performance PHP application servers that keep PHP processes running (instead of the traditional start-and-die model), achieving performance competitive with Go and Node.js.
Try this now
- Identify whether a site or client system you touch uses WordPress, Laravel, or plain older PHP.
- Read one route, controller, plugin config, or REST endpoint and identify what part is framework code versus application code.
- If it is WordPress, note whether you are dealing with theme work, plugin behavior, or headless API usage.
- Ask your agent to explain the codebase without stereotypes so you can assess the real maintenance risk.
Prompt to give your agent
"Help me understand this PHP or WordPress system pragmatically.
- Tell me whether I am looking at Laravel, WordPress, or custom legacy PHP
- Explain the overall architecture and where I should start reading
- Map the main concepts to frameworks and tools I already know
- Call out version, plugin, security, and maintenance risks
- Stop before recommending a rewrite unless the current system is truly unsafe or unmaintainable
Optimize for realistic maintenance and integration decisions."
What you must review yourself
- Whether the project is modern PHP, framework PHP, or truly old custom code
- Whether WordPress plugins, themes, or package versions create the real risk rather than PHP itself
- Whether the right path is maintenance, integration, headless use, or replacement
- Whether the agent is separating evidence from stereotypes when assessing the codebase
Common mistakes to avoid
- Judging PHP by old memes. The modern ecosystem is more capable than the reputation suggests.
- Assuming every PHP project is legacy spaghetti. Some are; many are not.
- Touching WordPress without checking plugin, theme, and update implications. Much of the operational risk lives there.
- Defaulting to a rewrite before understanding the business value of the existing system. Replacement is expensive and rarely the first answer.
Key takeaways
- PHP still matters because WordPress and Laravel keep it central to a huge part of the web
- The right question is not "is PHP cool" but "what kind of PHP system is this and how healthy is it"
- Agents are useful translators here, but you still need to inspect versions, plugins, framework choice, and maintenance surface
What's Next
You've now toured the major programming languages beyond JavaScript: Java for enterprise, C# for Microsoft shops, Python for data and scripting, Go for cloud infrastructure, and PHP for the web's long tail. Each has its place, and understanding the landscape makes you a more effective and versatile developer — no matter which language you primarily write.
