<?php $A = new class() { public $name; public function getName() : string { return $this->name; } }; $B = new $A(); $B->name = 'matti'; var_dump($B->getName());
You have javascript disabled. You will not be able to edit any code.