The close method is called on the underlying stream only if possible.
public function __destruct() { if (isset($this->_fn_close)) { ($this->_fn_close)(); } }