PHP 8.2 adds a new way of declaring classes: you can make them readonly. In practice, it means that all properties of that class will be readonly. This is especially useful when you're using data transfer objects or value objects, where a class only has public readonly properties.

2m read timeFrom stitcher.io
Post cover image

Sort: