value = $value; } public function __toString(): string { switch (gettype($this->value)) { case 'string': return '"' . $this->value . '"'; case 'object': if ($this->value instanceof DateTime) { return new Time($this->value); } return $this->value->__toString(); default: return (string)$this->value; } } }