How to Use Readonly Properties in PHP 8.1

Share
  • July 30, 2021
PHP 8.1 adds support for a readonly modifier on class properties. A property that’s tagged in this way can only be set once. Trying to change a readonly property’s value after initialization will throw an error.

Read This Article on CloudSavvy IT ›

Source : How to Use Readonly Properties in PHP 8.1