public function getKeyTTL($key) { $ttl_table = $this->read_TTL_table(); $key = (string) $key; if (!array_key_exists($key, $ttl_table)) { return false; } else { if ($ttl_table[$key] === 0) { return 0; } return $ttl_table[$key] - time(); } }