Skip to content

Commit

Permalink
Fully qualify PHP_INT_SIZE accesses in DataTypes.php
Browse files Browse the repository at this point in the history
  • Loading branch information
bwoebi committed Jul 13, 2019
1 parent a70dbcb commit 58bd8d2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/DataTypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public static function decodeStringOff(int $type, string $str, int &$off)

case self::MYSQL_TYPE_LONGLONG:
case self::MYSQL_TYPE_LONG | 0x80:
if (PHP_INT_SIZE < 8) {
if (\PHP_INT_SIZE < 8) {
return $type; // Return BIGINT and UNSIGNED INT as string on 32-bit.
}
// no break
Expand Down Expand Up @@ -304,7 +304,7 @@ public static function decodeInt8(string $str)
if ($int < (1 << 7)) {
return $int;
}
$shift = PHP_INT_SIZE * 8 - 8;
$shift = \PHP_INT_SIZE * 8 - 8;
return $int << $shift >> $shift;
}

Expand All @@ -319,7 +319,7 @@ public static function decodeInt16(string $str)
if ($int < (1 << 15)) {
return $int;
}
$shift = PHP_INT_SIZE * 8 - 16;
$shift = \PHP_INT_SIZE * 8 - 16;
return $int << $shift >> $shift;
}

Expand All @@ -334,7 +334,7 @@ public static function decodeInt24(string $str)
if ($int < (1 << 23)) {
return $int;
}
$shift = PHP_INT_SIZE * 8 - 24;
$shift = \PHP_INT_SIZE * 8 - 24;
return $int << $shift >> $shift;
}

Expand All @@ -345,7 +345,7 @@ public static function decodeUnsigned24(string $str)

public static function decodeInt32($str)
{
if (PHP_INT_SIZE > 4) {
if (\PHP_INT_SIZE > 4) {
$int = \unpack("V", $str)[1];
if ($int < (1 << 31)) {
return $int;
Expand All @@ -358,7 +358,7 @@ public static function decodeInt32($str)

public static function decodeUnsigned32(string $str)
{
if (PHP_INT_SIZE > 4) {
if (\PHP_INT_SIZE > 4) {
return \unpack("V", $str)[1];
}

Expand All @@ -368,7 +368,7 @@ public static function decodeUnsigned32(string $str)

public static function decodeInt64(string $str)
{
if (PHP_INT_SIZE > 4) {
if (\PHP_INT_SIZE > 4) {
return \unpack("P", $str)[1];
}

Expand Down

0 comments on commit 58bd8d2

Please sign in to comment.