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 12785 RSS ARTS 15 Photos

Popular News

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

United States

216.73.216.17 :: Total visit:


Welcome 996.73.996.97 Click here to Register or login
Oslo time:2026-06-24 Whos is online (last 1 min): 
1 - United States - 276.73.276.77
2 - United States - 74.7.227.44
3 - United States - 84.8.228.862
4 - United States - 74.7.227.49
5 - United States - 74.7.227.224
6 - United States - 79.7.299.98
7 - United Kingdom - 94.7.000.98
8 - Singapore - 27.72.202.27
9 - Singapore - 43.173.171.170
10 - Libya - 602.226.66.634
11 - Singapore - 994.999.936.8


Farsi English Norsk RSS