PHP has spent two decades as the internet's punching bag. The memes write themselves. But something changed around PHP 8.0, and 8.4 is the release that makes the haters look foolish. This is not the PHP you learned in 2010. This is a modern, type-safe, performant language with features that put it firmly in the same conversation as TypeScript and Go.
PHP 8.4 is not an upgrade. It is a statement.
Property hooks are the headline feature. They bring computed properties to PHP without the boilerplate of getters and setters. You define behavior directly on the property declaration, keeping your classes clean and your intent obvious.
<?php
declare(strict_types=1);
final class User
{
public string $name {
set(string $value) {
$this->name = trim($value);
}
get => ucfirst($this->name);
}
public string $email {
set(string $value) {
if (!filter_var($value, FILTER_VALIDATE_EMAIL)) {
throw new InvalidArgumentException('Invalid email');
}
$this->email = strtolower($value);
}
}
public readonly DateTimeImmutable $createdAt;
public function __construct()
{
$this->createdAt = new DateTimeImmutable();
}
}Then there is the new DOM API. The old DOMDocument was a relic — inconsistent, error-prone, and hostile to modern HTML5. The new HTML5 parser is spec-compliant, handles malformed markup gracefully, and finally makes server-side DOM manipulation feel natural instead of like a punishment.
<?php
$html = '<article><h1>Title</h1><p>Content</p></article>';
$dom = DOMHTMLDocument::createFromString($html);
$heading = $dom->querySelector('h1');
// Modify in place
$heading->textContent = 'Updated Title';
// Serialize back to clean HTML5
echo $dom->saveHTML();
// <article><h1>Updated Title</h1><p>Content</p></article>The JIT compiler continues to mature. In 8.4, it handles more opcode patterns and delivers consistent speedups for CPU-bound workloads. Combined with Fibers for async I/O and Attributes for declarative metadata, PHP now offers a genuinely modern development experience. The language that powered half the web is not just surviving — it is evolving with surgical precision.
Comments