diff --git a/src/Type/Definition/IntType.php b/src/Type/Definition/IntType.php index b732792..4473ce5 100644 --- a/src/Type/Definition/IntType.php +++ b/src/Type/Definition/IntType.php @@ -74,7 +74,10 @@ values. Int can represent values between -(2^31) and 2^31 - 1. '; */ public function parseValue($value) { - return (is_int($value) && $value <= self::MAX_INT && $value >= self::MIN_INT) ? $value : null; + // Below is a fix against PHP bug where (in some combinations of OSs and versions) + // boundary values are treated as "double" vs "integer" and failing is_int() check + $isInt = is_int($value) || $value === self::MIN_INT || $value === self::MAX_INT; + return $isInt && $value <= self::MAX_INT && $value >= self::MIN_INT ? $value : null; } /**