Skip to content

Commit 366175c

Browse files
committed
Keep original condition
1 parent d732dd4 commit 366175c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Types/BigIntType.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
use function is_int;
1212
use function is_string;
1313

14+
use const PHP_INT_MAX;
15+
use const PHP_INT_MIN;
16+
1417
/**
1518
* Type that attempts to map a database BIGINT to a PHP int.
1619
*
@@ -49,7 +52,10 @@ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): int
4952
'DBAL assumes values outside of the integer range to be returned as string by the database driver.',
5053
);
5154

52-
if ($value === (string) (int) $value) {
55+
if (
56+
($value > PHP_INT_MIN && $value < PHP_INT_MAX)
57+
|| $value === (string) (int) $value
58+
) {
5359
return (int) $value;
5460
}
5561

0 commit comments

Comments
 (0)