original_string: public function valid()
      {
          if ($this->_resource === null && $this->_filename) {
              $this->_resource = fopen($this->_filename, $this->_mode);
          }
          return !!$this->_resource && is_resource($this->_resource);
      }
code: public function valid()
      {
          if ($this->_resource === null && $this->_filename) {
              $this->_resource = fopen($this->_filename, $this->_mode);
          }
          return !!$this->_resource && is_resource($this->_resource);
      }
code_tokens: public function valid ( ) { if ( $ this -> _resource === null && $ this -> _filename ) { $ this -> _resource = fopen ( $ this -> _filename , $ this -> _mode ) ; } return ! ! $ this -> _resource && is_resource ( $ this -> _resource ) ; }
docstring: Check if the stream is valid.
  
  @return Boolean
docstring_tokens: Check if the stream is valid .