private function cleanup() { foreach ($this->cleanup as $key => $cleanupTask) { $cleanupTask(); unset($this->cleanup[$key]); } }