Are there any new features or improvements in PHP 8, such as Constructor promotion, that can simplify the process of assigning properties in constructors automatically?

In PHP, assigning properties in constructors can be a repetitive task, especially when dealing with a large number of properties. PHP 8 introduced Constructor Promotion, a new feature that allows developers to automatically assign properties in constructors by simply specifying the visibility and type of the property in the constructor parameters. This can simplify the process of assigning properties in constructors and make the code more concise and readable.

class User {
    public function __construct(
        public string $name,
        public string $email,
        public int $age
    ) {}
}

$user = new User('John Doe', 'john@example.com', 30);