In my script I need an open stream to a CSV file and my application will read single, many or all of its lines depending on different request, and store them in an array!
when and if we reach to the point that all lines been read and stored, the scrip will close the file.
but also i've added the close file method into the class destructor
public function __destruct()
{
fclose($this->handler)
}
I want to know if this is really necessary? or considering this is the end of lifecycle of my script, the file handler will be taken care by PHP's garbage collector and adding the above destruct method doesn't add any value?