Let's learn how you can efficiently use the new keyword readonly
introduced by PHP 8.1 π
By declaring class properties βreadonlyβ, the properties will only be allowed to be initialized once. Any further attempts to give another value will throw an error as it wonβt be allowed.
π My Udemy course on how to build a real-world PHP 8 application from scratch has just been released: udemy.com/course/create-real-world-php-weba..
Β