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

42 Articles 7383 RSS ARTS 13 Photos

Popular News

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

United States

3.148.171.222 :: Total visit:


Welcome 3.948.979.999 Click here to Register or login
Oslo time:2025-05-01 Whos is online (last 10 min): 
1 - United States - 3.948.979.222
2 - United States - 20.888.208.883
3 - United States - 58.588.55.256
4 - Singapore - 47.323.43.234
5 - United States - 66.559.77.555
6 - Singapore - 48.89.283.249
7 - United States - 58.556.23.578
8 - Singapore - 43.328.22.393
9 - Singapore - 000.009.033.00
10 - United States - 43.566.534.47
11 - Singapore - 27.228.22.282
12 - Singapore - 57.75.558.525
13 - United States - 98.224.72.997
14 - United States - 5.56.54.58
15 - Singapore - 004.009.035.229
16 - Singapore - 47.328.23.40
17 - Spain - 44.22.79.244
18 - United States - 58.557.95.255
19 - Singapore - 47.928.26.29
20 - United States - 38.339.302.303
21 - Singapore - 554.559.554.552
22 - United States - 3.638.666.683
23 - United States - 236.244.66.229
24 - Singapore - 57.79.599.35
25 - Singapore - 47.828.37.69
26 - Singapore - 47.79.235.33
27 - Singapore - 47.428.28.428
28 - Singapore - 444.444.434.245
29 - Singapore - 47.71.212.151
30 - Singapore - 47.79.212.32
31 - Singapore - 47.528.559.247
32 - United States - 66.649.66.668
33 - United States - 38.333.354.333
34 - Singapore - 444.449.458.50
35 - Singapore - 47.888.48.889


Farsi English Norsk RSS