# PHP 8.4 Features I can’t live without anymore

> Let’s cut to the chase. Here are the 3 features from PHP 8.4 that I can’t live without anymore.

Source: https://antistatique.net/en/blog/php-8-4-features-i-cant-live-without-anymore

Category: Development

# PHP 8.4 Features I can’t live without anymore

Author(s)

[

![Kevin](https://images.statique.ch/t/w_750,h_750,c_fill,f_jpeg,q_70/wp/app/uploads/2020/12/Kevin-300x300.jpg)



](/en/agence/kevin)

[Kevin](/en/agence/kevin)6 January 2026

PHP 8.4 was released on _November 21, 2024_. Today is… well, let’s just say it’s been a while.

![A futuristic, cybernetic blue PHP elephant mascot, glowing with neon purple and blue energy, emerging triumphantly from a pile of dusty, broken, outdated stone code blocks and tangled rusty chains. The elephant has sleek metallic armor and integrated glowing &quot;hooks&quot; on its trunk. In the background, a holographic interface displays clean, glowing PHP 8.4 syntax. The overall style is isometric digital art, highly detailed, tech-noir atmosphere, cinematic lighting. The text &quot;PHP 8.4&quot; is prominent and glowing in the center.](https://images.statique.ch/t/w_750,f_jpeg,q_70/wp/app/uploads/2025/12/Gemini_Generated_Image_prekc1prekc1prek-1-2600x1418.png)

Sneak peek of PHP 8.4's QOL upgrades, brought to life by Nano Banana 🐘

As we say in French: _mieux vaut tard que jamais_ — better late than never. And let’s be honest, when you’re juggling production projects, client deadlines, and that one legacy codebase that refuses to die, upgrading PHP isn’t always day-one priority.

But here we are! And I’m genuinely excited to share these features with you — even if half of you have probably been using them in production for months. No judgment from me. Okay, maybe a little judgment towards myself.

## 🪝**Property Hooks — The Game Changer**

Property hooks might be the biggest quality-of-life improvement since constructor property promotion. I’m not being dramatic — this genuinely changes how I write classes.

No more boilerplate getters. No more repetitive setters. You define the logic directly on the property itself.

Before PHP 8.4, a simple class with `getters` & `seters` looked like this:

```
class Player {
    private string $email;
    private string $firstName;
    private string $lastName;

    public function getEmail(): string {
        return $this->email;
    }

    public function setEmail(string $email): void {
        if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
            throw new InvalidArgumentException('Invalid email format');
        }
        $this->email = $email;
    }

    public function getFirstName(): string {
        return $this->firstName;
    }

    public function setFirstName(string $firstName): void {
        if (empty(trim($firstName))) {
            throw new InvalidArgumentException('First name cannot be empty');
        }
        $this->firstName = trim($firstName);
    }

    public function getLastName(): string {
        return $this->lastName;
    }

    public function setLastName(string $lastName): void {
        if (empty(trim($lastName))) {
            throw new InvalidArgumentException('Last name cannot be empty');
        }
        $this->lastName = trim($lastName);
    }

    public function getFullName(): string {
        return $this->firstName . ' ' . $this->lastName;
    }
}
```

As of PHP 8.4, all of that boilerplate can be reduced to this:

```
class Player {
    public string $email {
        set {
            if (!filter_var($value, FILTER_VALIDATE_EMAIL)) {
                throw new InvalidArgumentException('Invalid email format');
            }
            $this->email = $value;
        }
    }

    public string $firstName {
        set => trim($value) ?: throw new InvalidArgumentException('First name cannot be empty');
    }

    public string $lastName {
        set => trim($value) ?: throw new InvalidArgumentException('Last name cannot be empty');
    }

    public string $fullName {
        get => $this->firstName . ' ' . $this->lastName;
    }
}
```

Here’s the cool part: `$fullName` is a virtual property. It doesn't actually store data — it's computed on-the-fly from `firstName` and `lastName`. No wasted memory, no sync issues.

I could keep going, but others have already explored this better than I could. For the full deep-dive — asymmetric visibility, edge cases & advanced usage — check out these two excellent articles: [Property Hooks in PHP 8.4: Game Changer or Hidden Trap?](https://phpfashion.com/en/property-hooks-in-php-8-4) & [PHP 8.4 Property Hooks: The Game-Changer You’ve Been Waiting For](https://fsck.sh/en/blog/php-84-property-hooks-guide/).

## 🆕 `new` without Parentheses — Goodbye Brackets

PHP 8.4 brings another small-but-mighty improvement: you don’t have to wrap `new` invocations in parentheses anymore to chain methods.

Instead of this gymnastics:

```
$name = (new MyClass())->myMethod();
```

You can now simply write:

```
$name = new MyClass()->myMethod();
```

This might seem like a small change, but small improvements to developer experience compound over time. Your future self will thank you.

## 🏁 **The** `#[Deprecated]` **Attribute — Finally, Native Support**

Remember the good old `/** @deprecated */` docblock? Sure, _PHPStorm_ understood it, and static analysers like _PHPStan_ could catch it — but PHP itself? It couldn't care less. You were basically leaving a polite note that the language completely ignored.

Well, not anymore. PHP 8.4 introduces a native `#[Deprecated]` attribute that the engine actually respects. And the cherry on top? It enforces metadata to explain _what_ to use instead and _since when_ it's deprecated:

```
#[Deprecated(
    message: "use writeArticleOnTime() instead",
    since: "kevin/procrastination:13.0"
)]
function writeArticleAboutPHP84(): void
{
    // I'll do it next week, I promise
}
```

PHP 8.4 might be old news by now, but these features are here to stay. Property hooks, cleaner instantiation, native deprecations — small wins that make daily coding just a bit more enjoyable.

Now if you’ll excuse me, I have a PHP 8.5 article to procrastinate on.

❤️ Love on your keyboards.

## Sources

**stitcher.io** (Nov 2024) What’s new in PHP 8.4.  
[https://stitcher.io/blog/new-in-php-84](https://stitcher.io/blog/new-in-php-84)

**David Grudl (**Nov 2024**).** Property Hooks in PHP 8.4: Game Changer or Hidden Trap?  
[https://phpfashion.com/en/property-hooks-in-php-8-4](https://phpfashion.com/en/property-hooks-in-php-8-4)

**Matthias Breddin (**Nov 2025**).** PHP 8.4 Property Hooks: The Game-Changer You’ve Been Waiting For.  
[https://fsck.sh/en/blog/php-84-property-hooks-guide](https://fsck.sh/en/blog/php-84-property-hooks-guide/)

**PHP RFC** (Dec 2022) Property hooks.  
[https://wiki.php.net/rfc/property-hooks](https://wiki.php.net/rfc/property-hooks)

**PHP RFC** (Dec 2023) new MyClass()->method() without parentheses.  
[https://wiki.php.net/rfc/new\_without\_parentheses](https://wiki.php.net/rfc/new_without_parentheses)

**PHP RFC** (May 2024) #\[\\Deprecated\] Attribute.  
[https://wiki.php.net/rfc/deprecated\_attribute](https://wiki.php.net/rfc/deprecated_attribute)

## Resources

**Claude AI,** [https://claude.ai](https://claude.ai/)  
Helped with writing and text refinement.

**Nano Banana,** [https://gemini.google/overview/image-generation](https://gemini.google/overview/image-generation/)  
Generated the very accurate article’s cover illustration.

## More articles

Author(s)

[

![Anthony](https://images.statique.ch/t/w_750,h_750,c_fill,f_jpeg,q_70/wp/app/uploads/2024/11/anthony-1-300x300.png)



](/en/agence/anthony-salamone)

[Anthony](/en/agence/anthony-salamone)28 September 2026

### [Smashing Conference Freiburg 2026](/en/blog/smashing-conference-freiburg-2026)

Back in Freiburg for Smashing Conference 2026: AI and design systems, deeply technical CSS and HTML, and more human talks about teams and mindset. Here's what we took away.

Back in Freiburg for Smashing Conference 2026: AI and design systems, deeply technical CSS and HTML, and more human talks about teams and mindset. Here's what we took away.

[

![Smashing Conference Freiburg 2026 poster](https://images.statique.ch/t/w_750,h_500,c_fill,f_jpeg,q_70/assets/blog/smashing-2026.png)



](/en/blog/smashing-conference-freiburg-2026)

Author(s)

[

![Akira](https://images.statique.ch/t/w_750,h_750,c_fill,f_jpeg,q_70/wp/app/uploads/2025/03/akira-small-300x300.jpg)



](/en/agence/akira-kamata)

[Akira](/en/agence/akira-kamata)22 July 2026

### [Making of : “La nuit des Losers”](/en/blog/making-of-la-nuit-des-losers)

lanuitdeslosers.ch, built fast: paper wireframes, a bold hand-drawn identity, then Claude Code to prototype and ship. A mouse-tracking hero animation, a bowling game made of sponsor logos, and a few bugs we’re keeping.

lanuitdeslosers.ch, built fast: paper wireframes, a bold hand-drawn identity, then Claude Code to prototype and ship. A mouse-tracking hero animation, a bowling game made of sponsor logos, and a few bugs we’re keeping.

[

![Making of : “La nuit des Losers”](https://images.statique.ch/t/w_750,h_500,c_fill,f_jpeg,q_70/wp/app/uploads/2026/05/La-nuit-des-Losers-Teaser-1-768x576.png)



](/en/blog/making-of-la-nuit-des-losers)

Author(s)

[

![Pierre](https://images.statique.ch/t/w_750,h_750,c_fill,f_jpeg,q_70/wp/app/uploads/2020/12/Pierre-300x300.jpg)



](/en/agence/pierre)

[Pierre](/en/agence/pierre)7 July 2026

### [Dark mode: necessity or trend](/en/blog/dark-mode-necessity-or-trend)

Nous faisons le tri entre idées reçues, réalités techniques et bonnes pratiques de design.

Nous faisons le tri entre idées reçues, réalités techniques et bonnes pratiques de design.

[

![Dark mode: necessity or trend](https://images.statique.ch/t/w_750,h_500,c_fill,f_jpeg,q_70/wp/app/uploads/2026/07/1-768x384.png)



](/en/blog/dark-mode-necessity-or-trend)
