records[$record->data] = array($currentTime + $record->ttl, $record); } public function all() { return array_values(array_map( function ($value) { list($expiresAt, $record) = $value; return $record; }, $this->records )); } }