Best to know

  • PHP Integers

    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:

  • An integer must have at least one digit
  • An integer must NOT have a decimal point
  • An integer can be either positive or negative
  • Integers can be specified in three formats: decimal (base 10), hexadecimal (base 16 - prefixed with 0x), octal (base 8 - prefixed with 0) or binary (base 2 - prefixed with 0b)

PHP has the following predefined constants for integers:

  • PHP_INT_MAX - The largest integer supported
  • PHP_INT_MIN - The smallest integer supported
  • PHP_INT_SIZE -  The size of an integer in bytes

PHP has the following functions to check if the type of a variable is integer:



Leave A Comment


Last Visited Articles


Info Board

Visitor Counter
0
 

Todays visit

47 Articles 4882 RSS ARTS 15 Photos

Popular News

🚀 Welcome to our website! Stay updated with the latest news. 🎉

United States

216.73.216.0 :: Total visit:


Welcome 226.73.226.0 Click here to Register or login
Oslo time:2025-08-20 Whos is online (last 1 min): 
1 - United States - 266.73.266.0
2 - United States - 98.88.838.895
3 - United States - 1.91.211.16
4 - Germany - 844.76.38.840
5 - United States - 000.20.57.033
6 - United States - 52.0.42.264
7 - United States - 44.206.69.606
8 - United States - 606.20.686.648
9 - Singapore - 47.528.55.256
10 - United States - 99.292.906.979
11 - United States - 90.03.077.40
12 - United States - 66.249.78.35
13 - United States - 8.282.88.97
14 - United States - 99.209.99.93
15 - United States - 52.204.87.72
16 - United States - 44.244.39.444
17 - United States - 52.235.343.324
18 - United States - 23.28.889.232
19 - United States - 35.225.532.255


Farsi English Norsk RSS