public function __destruct() { if (isset($this->read_file) && isset($this->read_stream)) { fclose($this->read_stream); } if (isset($this->write_file) && isset($this->write_stream)) { fclose($this->write_stream); } return $this; }