static function decodeVersionInformation($versionBits)
 {
     $bestDifference = PHP_INT_MAX;
     $bestVersion = 0;
     for ($i = 0; $i < count(self::$VERSION_DECODE_INFO); $i++) {
         $targetVersion = self::$VERSION_DECODE_INFO[$i];
         // Do the version info bits match exactly? done.
         if ($targetVersion == $versionBits) {
             return self::getVersionForNumber($i + 7);
         }
         // Otherwise see if this is the closest to a real version info bit string
         // we have seen so far
         $bitsDifference = FormatInformation::numBitsDiffering($versionBits, $targetVersion);
         if ($bitsDifference < $bestDifference) {
             $bestVersion = $i + 7;
             $bestDifference = $bitsDifference;
         }
     }
     // We can tolerate up to 3 bits of error since no two version info codewords will
     // differ in less than 8 bits.
     if ($bestDifference <= 3) {
         return self::getVersionForNumber($bestVersion);
     }
     // If we didn't find a close enough match, fail
     return null;
 }