Skip to content

Commit 2346745

Browse files
Merge branch '7.4' into 8.0
* 7.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 c43dbd3 + 0d7c67f commit 2346745

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)