Integer Becomes Negative

no-email (Damien Seguy), Damien Seguy
Fri, 29 Jul 2022 00:00:00 +0000

$a is the largest integer in PHP. So, $b, which is one bigger than $a, is actually a float, which is bigger and still positive. When casting the float to an integer, the integer is turned into a negative number by overflowing.