true) */ protected $value = null; protected $ttl = 0; public function __construct($key, $value = null, $ttl = null) { $this->key = $key; if (!is_null($value)) { $this->value = $value; } $this->ttl = $ttl; } public function getKey(): string { return $this->key; } public function get() { return $this->value; } public function set($value): void { $this->value = $value; } public function getTtl(): ?int { return $this->ttl; } }