PHP·98 questions

What are readonly properties?

Answer
PHP 8.1+.
readonly public string $name;.
Set only once.
PHP 8.2: readonly class.
For immutable objects.
Was this answer helpful?

More questions in this topic

Related questions from other topics