diff --git a/src/Data/Number.php b/src/Data/Number.php index e06c90a03..34865ef14 100644 --- a/src/Data/Number.php +++ b/src/Data/Number.php @@ -143,7 +143,7 @@ final class Number extends QRDataModeAbstract{ } $result .= $toNumericChar((int)($threeDigitsBits / 100)); - $result .= $toNumericChar(($threeDigitsBits / 10) % 10); + $result .= $toNumericChar((int)($threeDigitsBits / 10) % 10); $result .= $toNumericChar($threeDigitsBits % 10); $length -= 3; diff --git a/src/Decoder/Binarizer.php b/src/Decoder/Binarizer.php index 94387d88e..0ad69de64 100644 --- a/src/Decoder/Binarizer.php +++ b/src/Decoder/Binarizer.php @@ -252,7 +252,7 @@ final class Binarizer{ // finish the rest of the rows quickly for($yy++, $offset += $width; $yy < self::BLOCK_SIZE; $yy++, $offset += $width){ for($xx = 0; $xx < self::BLOCK_SIZE; $xx++){ - $sum += $luminances[$offset + $xx] & 0xff; + $sum += $luminances[(int)($offset + $xx)] & 0xff; } } }