original_string: public function read($length = 1024)
      {
          if (!$this->connected && !$this->connect()) {
              return false;
          }
  
          if (!feof($this->connection)) {
              $buffer = fread($this->connection, $length);
              $info = stream_get_meta_data($this->connection);
              if ($info['timed_out']) {
                  $this->setLastError(E_WARNING, 'Connection timed out');
  
                  return false;
              }
  
              return $buffer;
          }
  
          return false;
      }
code: public function read($length = 1024)
      {
          if (!$this->connected && !$this->connect()) {
              return false;
          }
  
          if (!feof($this->connection)) {
              $buffer = fread($this->connection, $length);
              $info = stream_get_meta_data($this->connection);
              if ($info['timed_out']) {
                  $this->setLastError(E_WARNING, 'Connection timed out');
  
                  return false;
              }
  
              return $buffer;
          }
  
          return false;
      }
code_tokens: public function read ( $ length = 1024 ) { if ( ! $ this -> connected && ! $ this -> connect ( ) ) { return false ; } if ( ! feof ( $ this -> connection ) ) { $ buffer = fread ( $ this -> connection , $ length ) ; $ info = stream_get_meta_data ( $ this -> connection ) ; if ( $ info [ 'timed_out' ] ) { $ this -> setLastError ( E_WARNING , 'Connection timed out' ) ; return false ; } return $ buffer ; } return false ; }
docstring: Read data from the socket. Returns false if no data is available or no connection could be
  established.
  
  The bool false return value is deprecated and will be null in the next major.
  Please code respectively to be future proof.
  
  @param int $length Optional buffer length to read; defaults to 1024
  @return mixed Socket data
docstring_tokens: Read data from the socket . Returns false if no data is available or no connection could be established .