public function valid() { if (!is_array($this->currentRow)) { xml_parser_free($this->parser); fclose($this->file); return false; } return true; }