private function verifyMod10($input): bool
    {
        $sum = 0;
        $input = strrev($input);
        $inputLen = \strlen($input);
        for ($i = 0; $i < $inputLen; $i++) {
            $current = $input[$i];
            if ($i % 2 === 1) {
                $current *= 2;
                if ($current > 9) {
                    $firstDigit = $current % 10;
                    $secondDigit = ($current - $firstDigit) / 10;
                    $current = $firstDigit + $secondDigit;
                }
            }
            $sum += $current;
        }

        return ($sum % 10 === 0);
    }
private function verifyMod10($input): bool
    {
        $sum = 0;
        $input = strrev($input);
        $inputLen = \strlen($input);
        for ($i = 0; $i < $inputLen; $i++) {
            $current = $input[$i];
            if ($i % 2 === 1) {
                $current *= 2;
                if ($current > 9) {
                    $firstDigit = $current % 10;
                    $secondDigit = ($current - $firstDigit) / 10;
                    $current = $firstDigit + $secondDigit;
                }
            }
            $sum += $current;
        }

        return ($sum % 10 === 0);
    }
private function verifyMod10 ( $ input ) : bool { $ sum = 0 ; $ input = strrev ( $ input ) ; $ inputLen = \ strlen ( $ input ) ; for ( $ i = 0 ; $ i < $ inputLen ; $ i ++ ) { $ current = $ input [ $ i ] ; if ( $ i % 2 === 1 ) { $ current *= 2 ; if ( $ current > 9 ) { $ firstDigit = $ current % 10 ; $ secondDigit = ( $ current - $ firstDigit ) / 10 ; $ current = $ firstDigit + $ secondDigit ; } } $ sum += $ current ; } return ( $ sum % 10 === 0 ) ; }
Verify by Mod10

@param  string $input

@return bool
Verify by Mod10