From c05f798bb1fd8d9af5e3d293f4fb9b879b3f040e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Tue, 18 Jun 2024 12:16:27 +0200 Subject: [PATCH] Keep original condition --- src/Types/BigIntType.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Types/BigIntType.php b/src/Types/BigIntType.php index c617273b040..a9b096785cb 100644 --- a/src/Types/BigIntType.php +++ b/src/Types/BigIntType.php @@ -11,6 +11,9 @@ use function is_int; use function is_string; +use const PHP_INT_MAX; +use const PHP_INT_MIN; + /** * Type that attempts to map a database BIGINT to a PHP int. * @@ -49,7 +52,10 @@ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): int 'DBAL assumes values outside of the integer range to be returned as string by the database driver.', ); - if ($value === (string) (int) $value) { + if ( + ($value > PHP_INT_MIN && $value < PHP_INT_MAX) + || $value === (string) (int) $value + ) { return (int) $value; }