<?php class A { public int $v = 2; } class B extends A { public function getValue(A $v): void { echo $v->v; } } class C extends A { public int $v = 3 { set => $this->v * 2; } } $b = new B; $c = new C; $b->getValue($b); $b->getValue($c);
You have javascript disabled. You will not be able to edit any code.