original_string: public function range(int $start, int $length): string
      {
          if (!$length) {
              return "0";
          }
          if ($start + $length > $this->numBits()) {
              throw new \OutOfBoundsException("Not enough bits.");
          }
          $bits = gmp_init(0);
          $idx = $start;
          $end = $start + $length;
          while (true) {
              $bit = $this->testBit($idx) ? 1 : 0;
              $bits |= $bit;
              if (++$idx >= $end) {
                  break;
              }
              $bits <<= 1;
          }
          return gmp_strval($bits, 10);
      }
code: public function range(int $start, int $length): string
      {
          if (!$length) {
              return "0";
          }
          if ($start + $length > $this->numBits()) {
              throw new \OutOfBoundsException("Not enough bits.");
          }
          $bits = gmp_init(0);
          $idx = $start;
          $end = $start + $length;
          while (true) {
              $bit = $this->testBit($idx) ? 1 : 0;
              $bits |= $bit;
              if (++$idx >= $end) {
                  break;
              }
              $bits <<= 1;
          }
          return gmp_strval($bits, 10);
      }
code_tokens: public function range ( int $ start , int $ length ) : string { if ( ! $ length ) { return "0" ; } if ( $ start + $ length > $ this -> numBits ( ) ) { throw new \ OutOfBoundsException ( "Not enough bits." ) ; } $ bits = gmp_init ( 0 ) ; $ idx = $ start ; $ end = $ start + $ length ; while ( true ) { $ bit = $ this -> testBit ( $ idx ) ? 1 : 0 ; $ bits |= $ bit ; if ( ++ $ idx >= $ end ) { break ; } $ bits <<= 1 ; } return gmp_strval ( $ bits , 10 ) ; }
docstring: Get range of bits.
  
  @param int $start Index of first bit
  @param int $length Number of bits in range
  @throws \OutOfBoundsException
  @return string Integer of $length bits
docstring_tokens: Get range of bits .