<?php class A { readonly string $x; public function initFromA() { $this->x = 'a'; } } class B extends A { readonly string $x; public function initFromB() { $this->x = 'b'; } } $c = new B; $c->initFromB(); var_dump($c->x); $c->initFromA(); // Error: alredy initialized
You have javascript disabled. You will not be able to edit any code.