Skip to content

Commit

Permalink
Encode int as int64 only on 64-bit system
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas-novotny committed Feb 20, 2025
1 parent 6162894 commit fc5215c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Protocol/ProtocolWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public function appendFieldValue(mixed $value, Buffer $buffer): void
$buffer->append($value);

} elseif (is_int($value)) {
if ($value >= -2_147_483_648 && $value <= 2_147_483_647) {
if (PHP_INT_SIZE === 4) {
$buffer->appendUint8(Constants::FIELD_LONG_INT);
$buffer->appendInt32($value);
} else {
Expand Down

0 comments on commit fc5215c

Please sign in to comment.