Description
With constructor property promotion we're already achieved ability to skip a lot of boilerplate code. With property accessors (aka hooks) we could rid of getters and setters. But often classes need constructors only to set properties. And in such cases, constructors become redundant.
Thus, we would have possibility to skip constructors to initialize multiple properties at once:
readonly class User
{
public string $name;
public int $age;
}
$user = new User {
name: "John",
age: 42,
};
As a result, classes would be initialized in struct-like way. In looks like useful additional for "data" classes/DTOs etc.
I suppose it was discussed but was unable to find exact rfc or discussion.