original_string: public function negotiateTelnetOptions() {
  
          $c = $this->getc();
  
          if ($c != $this->IAC) {
  
              if (($c == $this->DO) || ($c == $this->DONT)) {
  
                  $opt = $this->getc();
                  fwrite($this->socket, $this->IAC . $this->WONT . $opt);
              } else if (($c == $this->WILL) || ($c == $this->WONT)) {
  
                  $opt = $this->getc();
                  fwrite($this->socket, $this->IAC . $this->DONT . $opt);
              } else {
                  throw new \Exception('Error: unknown control character ' . ord($c));
              }
          } else {
              throw new \Exception('Error: Something Wicked Happened');
          }
  
          return true;
      }
code: public function negotiateTelnetOptions() {
  
          $c = $this->getc();
  
          if ($c != $this->IAC) {
  
              if (($c == $this->DO) || ($c == $this->DONT)) {
  
                  $opt = $this->getc();
                  fwrite($this->socket, $this->IAC . $this->WONT . $opt);
              } else if (($c == $this->WILL) || ($c == $this->WONT)) {
  
                  $opt = $this->getc();
                  fwrite($this->socket, $this->IAC . $this->DONT . $opt);
              } else {
                  throw new \Exception('Error: unknown control character ' . ord($c));
              }
          } else {
              throw new \Exception('Error: Something Wicked Happened');
          }
  
          return true;
      }
code_tokens: public function negotiateTelnetOptions ( ) { $ c = $ this -> getc ( ) ; if ( $ c != $ this -> IAC ) { if ( ( $ c == $ this -> DO ) || ( $ c == $ this -> DONT ) ) { $ opt = $ this -> getc ( ) ; fwrite ( $ this -> socket , $ this -> IAC . $ this -> WONT . $ opt ) ; } else if ( ( $ c == $ this -> WILL ) || ( $ c == $ this -> WONT ) ) { $ opt = $ this -> getc ( ) ; fwrite ( $ this -> socket , $ this -> IAC . $ this -> DONT . $ opt ) ; } else { throw new \ Exception ( 'Error: unknown control character ' . ord ( $ c ) ) ; } } else { throw new \ Exception ( 'Error: Something Wicked Happened' ) ; } return true ; }
docstring: Telnet control character magic
  
  @param string $command Character to check
  @return boolean
docstring_tokens: Telnet control character magic