PHP & Zend Engine (50 Qs)•Part 2: Zend Engine Internals, OPcache & Memory Architecture (11 - 24)
What are Readonly Classes and Properties and what guarantees do they provide?
senior LevelMost AskedSystem Design
In Simple Words:
A readonly property can only be initialized once within its declared scope and can never be mutated afterward. Declaring readonly class enforces immutability across all instance properties.