<?php class X { public string $p { set(string|A|null $value) { $this->p = (string) $value; } get => $this-p . ' more'; } } class A { function __toString() { return 'abc'; } } $x = new X; $x->p = new A;
You have javascript disabled. You will not be able to edit any code.