Development Tips

PHP in 2026: What Actually Changed and What Still Works

By Ken Key Oct 22, 2025 4 min read Updated Oct 16, 2026

PHP in 2026: What Actually Changed and What Still Works
The short answer

PHP 8.4 and 8.5 are current in 2026, and 8.2 is the practical minimum since 7.4 and 8.0 no longer get security patches. The language still runs most of the web. What changed is the code you write: typed properties, readonly, enums, and match instead of old arrays and switch blocks.

Part of the complete web development guide.

On this page

PHP has been “dead” for about fifteen years now, and it’s still running a huge chunk of the web, including most of the sites I maintain for clients around Long Island. But the language people dismiss and the language you actually write in 2026 are not the same thing. If you’re still on PHP 7.x or writing 8.x code like it’s 2015, here’s what’s actually worth changing.

Where PHP Actually Stands in 2026

PHP 8.4 shipped in late 2024 and 8.5 landed in November 2025. PHP 7.4 and 8.0 are long past end of life, which means no security patches. If you’re running either of those on a production box, that’s the single highest-priority fix on your list, ahead of any refactor, redesign, or feature work.

The practical baseline now is 8.2 or newer. Most decent hosts support it, and the performance and safety gains over 7.x are real, not marketing. If your host won’t let you pick 8.2+, that tells you something about the host.

Language Features I Actually Use

Not everything new is worth adopting. Here’s what has earned a place in my day-to-day code versus what I mostly ignore.

Constructor property promotion and readonly

This cut a lot of boilerplate out of my classes. Instead of declaring properties, then assigning them in the constructor, you declare and assign in one place.

final class Invoice
{
 public function __construct(
 public readonly int $id,
 public readonly string $customer,
 private array $lines = [],
 ) {}

 public function total(): float
 {
 return array_sum(array_map(
 fn($line) => $line['qty'] * $line['price'],
 $this->lines
 ));
 }
}

Readonly properties are the part that matters most to me. Once set, they can’t be reassigned, which kills a whole category of “who changed this and when” bugs.

Enums

If you’re still passing magic strings around for statuses, stop. Enums give you real types and let the compiler catch typos before a customer does.

enum OrderStatus: string
{
 case Pending = 'pending';
 case Shipped = 'shipped';
 case Cancelled = 'cancelled';

 public function canCancel(): bool
 {
 return $this === self::Pending;
 }
}

// usage
if ($order->status->canCancel()) {
 // ...
}

Backed enums (the ones with a string or int value) are the useful kind for anything touching a database or an API.

Match expressions

Match is a cleaner switch. It returns a value, it’s strict about types, and it throws if nothing matches, which is usually what you want.

$label = match ($status) {
 OrderStatus::Pending => 'Awaiting payment',
 OrderStatus::Shipped => 'On its way',
 OrderStatus::Cancelled => 'Cancelled',
};

What I skip

Named arguments are fine but I find they get overused and make call sites brittle. First-class callable syntax is nice but not something I reach for daily. I don’t chase every feature; I use what makes code easier to read six months later.

The Stuff That Bites People

Features are the fun part. The mistakes are the expensive part.

  • Running unsupported versions. No patches means every known vulnerability stays known. Upgrade.
  • Ignoring strict types. Put declare(strict_types=1); at the top of every file. PHP’s loose comparisons are a footgun that strict mode mostly disarms.
  • Trusting user input. Prepared statements for every query, no exceptions. Never build SQL by concatenating strings.
  • No dependency updates. Run composer outdated on a schedule. Old packages are a common way in.
  • Error display in production. display_errors should be off in prod and on in dev. Leaking stack traces to the public is a gift to attackers.

A Word on Frameworks

Laravel and Symfony are both in good shape and both run fine on modern PHP. If you’re starting something new, picking one of them beats hand-rolling your own framework, which is a lesson a lot of us learn the hard way. If you inherited a legacy app with no framework, you don’t have to rewrite it from scratch; you can modernize it piece by piece, upgrading PHP first, then tightening types, then extracting the worst code into testable classes.

For a lot of the work I do, from small business sites to custom web development for clients here in Commack and across Long Island, the goal isn’t to use every new feature. It’s to leave behind code that the next person (often me, two years later) can read and safely change.

Should You Upgrade Right Now?

If you’re on 8.0 or older, yes, and soon. If you’re on 8.2 or 8.3, you’re in a fine spot, but plan to move to 8.4 or 8.5 within the year so you’re not scrambling when support ends. Test on a staging copy first. The upgrade itself is usually the easy part; the surprises are in old dependencies and code that depended on loose typing.

FAQ

Is PHP still worth learning in 2026?

Yes. It powers a huge number of sites, jobs are steady, and the modern language is far better than its reputation. If you can write clean PHP, you’ll find work.

What’s the minimum PHP version I should run?

8.2 at the absolute minimum, and 8.4 or newer if you can. Anything below 8.2 is either unsupported or close to it.

Do I need to rewrite my old code to use new features?

No. Upgrade the runtime first, then improve code as you touch it. Big rewrites are risky and rarely finish; small, steady improvements add up.

Have a project like this?

I do custom web development for Long Island businesses. If you need this done right, let’s talk.