Skip to content

Commit 90208e2

Browse files
Merge branch '6.4' into 7.3
* 6.4: don't cast strings exceeding the min/max int ranges do not pass the empty string to ord() do not coerce NAN to other types fix transient Console output related test
2 parents d4f4a66 + 0fc8b96 commit 90208e2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Inline.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,10 @@ private static function evaluateScalar(string $scalar, int $flags, array &$refer
714714
switch (true) {
715715
case ctype_digit($scalar):
716716
case '-' === $scalar[0] && ctype_digit(substr($scalar, 1)):
717+
if ($scalar < \PHP_INT_MIN || \PHP_INT_MAX < $scalar) {
718+
return $scalar;
719+
}
720+
717721
$cast = (int) $scalar;
718722

719723
return ($scalar === (string) $cast) ? $cast : $scalar;

0 commit comments

Comments
 (0)