public function valid()
    {
        if ($this->_resource === null && $this->_filename) {
            $this->_resource = fopen($this->_filename, $this->_mode);
        }
        return !!$this->_resource && is_resource($this->_resource);
    }
public function valid()
    {
        if ($this->_resource === null && $this->_filename) {
            $this->_resource = fopen($this->_filename, $this->_mode);
        }
        return !!$this->_resource && is_resource($this->_resource);
    }
public function valid ( ) { if ( $ this -> _resource === null && $ this -> _filename ) { $ this -> _resource = fopen ( $ this -> _filename , $ this -> _mode ) ; } return ! ! $ this -> _resource && is_resource ( $ this -> _resource ) ; }
Check if the stream is valid.

@return Boolean
Check if the stream is valid .