PHP 8.1 added the readonly modifier for typed properties, allowing them to be initialized once (typically in the constructor) and never modified afterward. Attempting to reassign a readonly property throws an Error.
Readonly properties are commonly combined with constructor promotion to build immutable value objects and DTOs concisely.