PHP 31-th Anniversary — A Quick Look at the Evolution of the Language Code from Version 7.4 to 8.4

🎉 PHP 31-th Anniversary — A Quick Look at the Evolution of the Language from 7.4 to 8.4

PHP has come a long way — from a simple scripting tool to a powerful modern language with JIT, async capabilities, enums, readonly classes, and property hooks.
Today, on June 8, 2026, (31-th PHP programming language birthday) the anniversary of PHP’s creation, let’s take a look at how the language has evolved over the last seven years, and what features were introduced in each version.


🟦 PHP 8.4 — Property Hooks, Async, Immutable Classes

PHP 8.4 (2024) became one of the most innovative releases in recent years.

Key features:

  • Property hooks (getters/setters directly in property declarations)
  • Async functions — native asynchronous support
  • Standalone null/true/false types
  • Improved DOM API
  • Immutable classes (an extension of the readonly concept)

✔ Example: Property Hooks

class Locale {
    public string $countryCode {
        set(string $value) {
            $this->countryCode = strtoupper($value);
        }
    }

    public string $combinedCode {
        get => "{$this->languageCode}_{$this->countryCode}";
        set(string $value) {
            [$this->languageCode, $this->countryCode] = explode('_', $value);
        }
    }

    public function __construct(
        public string $languageCode,
        public string $countryCode
    ) {}
}

$loc = new Locale('uk', 'ua');
$loc->countryCode = 'pl'; // PL
echo $loc->combinedCode;  // uk_PL

🟩 PHP 8.3 — Typed Class Constants, Granular Exceptions

PHP 8.3 (2023) is a stabilization release, but still an important one.

Key features:

  • Typed class constants
  • Granular DateTime exceptions
  • Fallback values for environment variables in INI

✔ Typed Class Constants

class Status {
    public const string ACTIVE = 'active';
    public const string BLOCKED = 'blocked';
}

🟧 PHP 8.2 — Readonly Classes, DNF Types, New Random API

PHP 8.2 (2022) made the language significantly stricter and more robust.

Key features:

  • Readonly classes
  • DNF types (Disjunctive Normal Form types)
  • true/false/null as standalone types
  • New Random API

✔ Readonly Class

readonly class UserData {
    public function __construct(
        public string $name,
        public int $age
    ) {}
}

$user = new UserData('Taras', 30);
// $user->name = 'Ivan'; // Fatal error

🟨 PHP 8.1 — Enums, Fibers, Readonly Properties

PHP 8.1 (2021) is one of the most important releases of the decade.

Key features:

  • Enums
  • Fibers (foundation for async)
  • Readonly properties
  • Intersection types
  • never type

✔ Enums

enum Status: string {
    case Draft = 'draft';
    case Published = 'published';
}

function publish(Status $status) {
    if ($status === Status::Draft) {
        echo "Publishing...";
    }
}

🟦 PHP 8.0 — JIT, Union Types, Match, Named Arguments

PHP 8.0 (2020) was a revolutionary release.

Key features:

  • JIT compilation
  • Union types
  • Match expression
  • Named arguments
  • Constructor property promotion

✔ Match Expression

$status = 'pending';

$message = match ($status) {
    'pending' => 'Waiting...',
    'done'    => 'Completed!',
    default   => 'Unknown',
};

🟫 PHP 7.4 — Typed Properties, Arrow Functions

PHP 7.4 (2019) — the final release of the 7.x branch.

Key features:

  • Typed properties
  • Arrow functions
  • Null‑coalescing assignment (??=)
  • OpCache improvements

✔ Arrow Function

$numbers = [1, 2, 3];
$squares = array_map(fn($n) => $n * $n, $numbers);

📌 Feature Comparison Table

Version Key Features
PHP 8.4 Property hooks, async, immutable classes
PHP 8.3 Typed constants, granular exceptions
PHP 8.2 Readonly classes, DNF types, Random API
PHP 8.1 Enums, Fibers, readonly properties
PHP 8.0 JIT, union types, match, named args
PHP 7.4 Typed properties, arrow functions

🎯 Conclusion

Over the past years, PHP has transformed into a modern, type‑safe, high‑performance language with async support, strict typing, enums, readonly structures, and JIT.
It is no longer the “old PHP,” but a fully capable language for high‑load systems, microservices, and complex domain models.

Leave a Reply

Your email address will not be published. Required fields are marked *