original_string: public static function luhn($input) {
          if ($input == 0) {
              return false;
          }
  
          $sum = 0;
          $length = mb_strlen($input);
  
          for ($position = 1 - ($length % 2); $position < $length; $position += 2) {
              $sum += $input[$position];
          }
  
          for ($position = ($length % 2); $position < $length; $position += 2) {
              $number = $input[$position] * 2;
              $sum += ($number < 10) ? $number : $number - 9;
          }
  
          return ($sum % 10 == 0);
      }
code: public static function luhn($input) {
          if ($input == 0) {
              return false;
          }
  
          $sum = 0;
          $length = mb_strlen($input);
  
          for ($position = 1 - ($length % 2); $position < $length; $position += 2) {
              $sum += $input[$position];
          }
  
          for ($position = ($length % 2); $position < $length; $position += 2) {
              $number = $input[$position] * 2;
              $sum += ($number < 10) ? $number : $number - 9;
          }
  
          return ($sum % 10 == 0);
      }
code_tokens: public static function luhn ( $ input ) { if ( $ input == 0 ) { return false ; } $ sum = 0 ; $ length = mb_strlen ( $ input ) ; for ( $ position = 1 - ( $ length % 2 ) ; $ position < $ length ; $ position += 2 ) { $ sum += $ input [ $ position ] ; } for ( $ position = ( $ length % 2 ) ; $ position < $ length ; $ position += 2 ) { $ number = $ input [ $ position ] * 2 ; $ sum += ( $ number < 10 ) ? $ number : $ number - 9 ; } return ( $ sum % 10 == 0 ) ; }
docstring: Luhn algorithm.
  
  @param string $input
  @return bool
  @link http://en.wikipedia.org/wiki/Luhn_algorithm
docstring_tokens: Luhn algorithm .