An integer is a number without any decimal part.
In 32-bit systems, the integer data type represents non-decimal numbers between -2147483648 and 2147483647. In 64-bit systems, it represents numbers between -9223372036854775808 and 9223372036854775807. Values outside these ranges will be stored as floats because they exceed the limits of an integer.
Note: It’s important to know that even if the result of 4 * 2.5 is 10, it will be stored as a float because one of the operands (2.5) is a float.
Here are some rules for integers:
PHP has the following predefined constants for integers:
PHP provides the following functions to check if a variable is of integer type
Verify if a variable is of integer type:
$x $x
|