build(); class MyObject extends DbObject { public function __construct( public readonly string $value ) { } } $db->set("a", new MyObject('v')); $obj = $db->get("a"); var_dump($obj->value);