original_string: public function write ( $chunk ) {
  			if( $this->write_finished ) { throw new InvalidOperationException( "Can not write, reading has started." ); }
  
  			if( ! $this->write_started ) {
  				fwrite( $this->socket, "\r\n" ); // Start message body
  				$this->write_started = true;
  			}
  	
  			fwrite( $this->socket, sprintf( "%x\r\n", strlen( $chunk ) ) );
  			fwrite( $this->socket, $chunk );
  			fwrite( $this->socket, "\r\n" );
  			fflush( $this->socket );
  		}
code: public function write ( $chunk ) {
  			if( $this->write_finished ) { throw new InvalidOperationException( "Can not write, reading has started." ); }
  
  			if( ! $this->write_started ) {
  				fwrite( $this->socket, "\r\n" ); // Start message body
  				$this->write_started = true;
  			}
  	
  			fwrite( $this->socket, sprintf( "%x\r\n", strlen( $chunk ) ) );
  			fwrite( $this->socket, $chunk );
  			fwrite( $this->socket, "\r\n" );
  			fflush( $this->socket );
  		}
code_tokens: public function write ( $ chunk ) { if ( $ this -> write_finished ) { throw new InvalidOperationException ( "Can not write, reading has started." ) ; } if ( ! $ this -> write_started ) { fwrite ( $ this -> socket , "\r\n" ) ; // Start message body $ this -> write_started = true ; } fwrite ( $ this -> socket , sprintf ( "%x\r\n" , strlen ( $ chunk ) ) ) ; fwrite ( $ this -> socket , $ chunk ) ; fwrite ( $ this -> socket , "\r\n" ) ; fflush ( $ this -> socket ) ; }
docstring: Write a chunk of data
  @param $chunk
docstring_tokens: Write a chunk of data