2, 256, -256, 10358, -179567 are all integers.
An integer is a number without any decimal part.
An integer data type is a non-decimal number between -2147483648 and 2147483647 in 32 bit systems, and between -9223372036854775808 and 9223372036854775807 in 64 bit systems. A value greater (or lower) than this, will be stored as float, because it exceeds the limit of an integer.
Note: Another important thing to know is that even if 4 * 2.5 is 10, the result is stored as float, because one of the operands is a float (2.5).
Here are some rules for integers:
PHP has the following predefined constants for integers:
PHP_INT_MAX
- The largest integer supportedPHP_INT_MIN
- The smallest integer supportedPHP_INT_SIZE
- The size of an integer in bytesPHP has the following functions to check if the type of a variable is integer:
A Journey Through Time: The History of Canon Cameras Jan 28, 2025
Fiber Internet: The Gold Standard of Connectivity Jan 22, 2025
The Best Windows Applications You Should Have Jan 22, 2025