Skip to main content

Staying Current with Drupal’s Plugin API Evolution: Adapting Tutorials for PHP Attributes

Drupal's Plugin API has been a key part of its flexibility and extensibility, allowing developers to add custom functionality in a clean and modular way. With the release of modern PHP features, such as PHP attributes, Drupal is evolving to improve the way plugins are defined and managed. This change introduces a cleaner, more efficient way to work with plugins, as it moves away from docblock annotations and embraces a more native PHP approach.

What's New in PHP 8.4: Key Features, Updates, and Deprecated Elements

PHP 8.4, released on November 21, 2024, introduces several significant features and changes aimed at enhancing code quality, performance, and developer experience. Here's an overview of the key updates:

1. Property Hooks

Property hooks allow developers to define custom behavior for property access and modification directly within the class, eliminating the need for traditional getters and setters. This feature simplifies class design and enhances maintainability. citeturn0search0

2. Asymmetric Visibility

PHP 8.4.4: Latest Version Released

The latest version of PHP is 8.4.4, which was released on February 13, 2025. PHP 8.4 is the current development branch for new features and major changes. [1, 2]  
PHP version release dates [3]  

• PHP 8.4: Released on November 21, 2024 
• PHP 8.3: Released on November 23, 2023 
• PHP 8.2: Released on December 8, 2022 
• PHP 8.1: Released on November 25, 2021

New features in PHP 8.3 [1, 4]  

PHP 8.4 Released with Property Hooks, Simplified Class Instantiation, and More Enhancements

"PHP 8.4 Released with New Array Find Functions, Property Hooks, Simplified Class Instantiation, and More" 

# New Array Find Functions in PHP 8.4

 PHP 8.4 introduces new array find functions, including: - `array_find()` - `array_find_key()` - `array_any()` - `array_all()`

PHP Property Hooks

Property hooks in PHP are inspired by languages like Kotlin, C#, and Swift. The syntax includes two variants, resembling short and multi-line closures.