original_string: public function addOneToBytePreserveCarry($currentByte, &$carry) {
          for( $i = 0; $i < 8; $i++ ){
              $bitMaskValue = pow( 2, $i );
              $mask = chr( $bitMaskValue );
              $filteredBit = $currentByte & $mask;
              if( $carry == 1 && ord( $filteredBit ) == 0 ){
                  $currentByte |= $mask;
                  $carry = 0;
              }else if($carry == 1 && ord( $filteredBit ) >= 1){
                  $flipMask = ~$mask;
                  $currentByte &= $flipMask;
                  //carry bit remains unchanged
              } 
          }
          return $currentByte;
      }
code: public function addOneToBytePreserveCarry($currentByte, &$carry) {
          for( $i = 0; $i < 8; $i++ ){
              $bitMaskValue = pow( 2, $i );
              $mask = chr( $bitMaskValue );
              $filteredBit = $currentByte & $mask;
              if( $carry == 1 && ord( $filteredBit ) == 0 ){
                  $currentByte |= $mask;
                  $carry = 0;
              }else if($carry == 1 && ord( $filteredBit ) >= 1){
                  $flipMask = ~$mask;
                  $currentByte &= $flipMask;
                  //carry bit remains unchanged
              } 
          }
          return $currentByte;
      }
code_tokens: public function addOneToBytePreserveCarry ( $ currentByte , & $ carry ) { for ( $ i = 0 ; $ i < 8 ; $ i ++ ) { $ bitMaskValue = pow ( 2 , $ i ) ; $ mask = chr ( $ bitMaskValue ) ; $ filteredBit = $ currentByte & $ mask ; if ( $ carry == 1 && ord ( $ filteredBit ) == 0 ) { $ currentByte |= $ mask ; $ carry = 0 ; } else if ( $ carry == 1 && ord ( $ filteredBit ) >= 1 ) { $ flipMask = ~ $ mask ; $ currentByte &= $ flipMask ; //carry bit remains unchanged } } return $ currentByte ; }
docstring: We add one by inserting the 1 into the first carry bit.
  
  This is public for testing only.
  
  @param type $currentByte
  @param type $carry
docstring_tokens: We add one by inserting the 1 into the first carry bit .