Web Development & PHP 2026-11-08 ยท 6 min read

PHP 8.4 in Production: Property Hooks, Asymmetric Visibility & Real Performance

Carlos Del Hierro
Carlos Del Hierro
Senior Drupal 10/11 & AI Architect ยท 10+ years Drupal experience
PHP 8.4 in Production: Property Hooks, Asymmetric Visibility & Real Performance

PHP 8.4 brings some of the most practical developer-experience upgrades in years for engineers building backends on Symfony and Drupal 11. Beyond Zend engine speedups, two features drastically cut daily boilerplate: Property Hooks and asymmetric visibility.

1. Property Hooks: Replacing Trivial Getters and Setters

Validating or normalizing a property on assignment used to require private fields plus manual getter/setter methods. PHP 8.4 lets you attach get and set hooks directly to the property:

class ArticleMetadata {
  public string $slug {
    set(string $value) => strtolower(trim(preg_replace('/[^a-z0-9]+/i', '-', $value), '-'));
  }

  public function __construct(
    public private(set) string $author = 'Carlos Del Hierro',
  ) {}
}

2. Asymmetric Visibility (public private(set))

With public private(set), DTOs and API response objects can expose read-only public properties without allowing external mutation.

3. Built-in array_find(), array_any() & array_all()

  • array_find($items, fn($x) => $x->isActive()) returns the first matching item cleanly without manual foreach loops.
  • array_any() and array_all() make business-rule validators shorter and easier to read.

Upgrading your Drupal 10/11 or Symfony stack to PHP 8.4 reduces memory overhead, lowers TTFB, and keeps your codebase modern.

#PHP 8.4 #Drupal 11 #Backend #Performance

Want to implement this in your Drupal platform?

Have questions about this architecture, Drupal 11 + PHP 8.4, or AI/MCP workflows? Feel free to reach out and connect.