| @@ 431-440 (lines=10) @@ | ||
| 428 | * @param integer $int An integer |
|
| 429 | * @return integer An signed 32 bit integer |
|
| 430 | */ |
|
| 431 | public static function sInt32($int) |
|
| 432 | { |
|
| 433 | if (PHP_INT_SIZE === 4) { |
|
| 434 | // 32 bit |
|
| 435 | return self::sInt($int); |
|
| 436 | } else // PHP_INT_SIZE === 8 // 64 bit |
|
| 437 | { |
|
| 438 | $arr = unpack("l", pack("l", $int)); |
|
| 439 | return $arr[1]; |
|
| 440 | } |
|
| 441 | } |
|
| 442 | ||
| 443 | ||
| @@ 450-459 (lines=10) @@ | ||
| 447 | * @param integer $int An integer |
|
| 448 | * @return integer An unsigned 32 bit integer |
|
| 449 | */ |
|
| 450 | public static function uInt32($int) |
|
| 451 | { |
|
| 452 | if (PHP_INT_SIZE === 4) { |
|
| 453 | // 32 bit |
|
| 454 | return self::uInt($int); |
|
| 455 | } else // PHP_INT_SIZE === 8 // 64 bit |
|
| 456 | { |
|
| 457 | $arr = unpack("L", pack("L", $int)); |
|
| 458 | return $arr[1]; |
|
| 459 | } |
|
| 460 | } |
|
| 461 | ||
| 462 | ||