public function __destruct() { if ($this->fp) { fclose($this->fp); } if (!$this->success) { if (file_exists($this->destination)) { unlink($this->destination); } } }