In this video, I'm going to talk about the new first-class "readonly" properties in PHP 8.1. Essentially, now it will be possible to declare a property as “read only” using the readonly keyword.
Using the readonly properties, classes can get rid of the getters and setters and in turn, makes them more concise and crisp.
Also, DTOs (Data Transfer Objects) can be built far more conveniently using readonly properties!
Companion article: https://www.amitmerchant.com/readonly...
Step up your game with PHP with my book "PHP 8 in a Nutshell": https://amitmerchant.gumroad.com/l/ph...
You can follow me on Twitter: / amit_merchant