We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dc363be commit 8df044dCopy full SHA for 8df044d
lib/Column.php
@@ -117,10 +117,16 @@ public static function castIntegerSafely($value): string|int
117
return $value;
118
}
119
120
+ // string representation of a float
121
+ elseif ((string) (float) $value === $value && (string) (int) $value !== $value) {
122
+ return (int) $value;
123
+ }
124
+
125
// If adding 0 to a string causes a float conversion,
126
// we have a number over PHP_INT_MAX
- elseif (is_string($value) && 1 === bccomp($value, (string) PHP_INT_MAX)) {
- return $value;
127
+ // @phpstan-ignore-next-line
128
+ elseif (is_string($value) && is_float($value + 0)) {
129
+ return (string) $value;
130
131
132
// If a float was passed and is greater than PHP_INT_MAX
0 commit comments