Skip to content

Commit 42c2d70

Browse files
authored
Merge pull request #28 from DaveRandom/32bit-8.2
Fix deprecation warning on 32 bit on 8.2
2 parents e8b6d65 + 81281b9 commit 42c2d70

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/Records/Types/DomainName.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323
class DomainName extends Type
2424
{
25-
const FLAG_NO_COMPRESSION = 0x80000000;
25+
const FLAG_NO_COMPRESSION = \PHP_INT_SIZE === 4 ? -2147483648 : 0x80000000;
2626

2727
/**
2828
* @var string

src/Records/Types/Long.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ public function setValue($value)
3838
{
3939
$value = (int)$value;
4040

41-
if ($value < 0) {
42-
throw new \UnderflowException('Long integer value must be in the range 0 - 4294967296');
43-
} else if ($value > 0xffffffff) {
44-
throw new \OverflowException('Long integer value must be in the range 0 - 4294967296');
41+
if (\PHP_INT_SIZE > 4) {
42+
if ($value < 0) {
43+
throw new \UnderflowException('Long integer value must be in the range 0 - 4294967296');
44+
} else if ($value > 0xffffffff) {
45+
throw new \OverflowException('Long integer value must be in the range 0 - 4294967296');
46+
}
4547
}
4648

4749
$this->value = $value;

0 commit comments

Comments
 (0)