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 8406 RSS ARTS 107 Photos

Popular News

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

United States

18.223.109.25 :: Total visit:


Welcome 58.553.509.55 Click here to Register or login
Oslo time:2025-05-04 Whos is online (last 10 min): 
1 - United States - 48.224.449.25
2 - United States - 66.249.40.34
3 - Singapore - 47.228.27.252
4 - United States - 957.55.39.96
5 - Singapore - 47.228.22.228
6 - Singapore - 004.009.000.065
7 - United States - 66.549.75.33
8 - Singapore - 47.448.48.440
9 - United States - 98.229.3.26
10 - United States - 1a03:1880:f800:1::
11 - Singapore - 40.008.08.46
12 - Singapore - 47.444.55.469
13 - United States - 55.549.70.35
14 - Singapore - 77.728.722.233
15 - Singapore - 664.666.626.74
16 - Singapore - 49.928.29.94
17 - United States - 77.277.230.70
18 - United States - 2a99:2889:f899:e::
19 - Singapore - 45.528.555.55
20 - United States - 66.229.70.39
21 - Singapore - 40.028.52.080
22 - Singapore - 47.998.99.936
23 - United States - 0a03:0880:f800:0a::
24 - United States - 52.167.144.166
25 - Singapore - 47.626.46.22
26 - United States - 3.147.14.87
27 - Singapore - 47.628.626.206
28 - Singapore - 47.528.49.250
29 - United States - 101.11.108.39
30 - United States - 35.060.002.05
31 - United States - 42.207.47.227
32 - United States - 8.280.224.6
33 - United States - 100.21.133.214
34 - Singapore - 47.428.32.47
35 - United States - 44.880.804.855
36 - United States - 22.24.228.67
37 - Singapore - 47.328.23.347
38 - Singapore - 47.424.32.444
39 - Singapore - 994.999.930.298
40 - Singapore - 47.668.39.663
41 - Singapore - 44.428.425.50
42 - United States - 88.887.872.258
43 - United States - 2a03:2880:f800:70::
44 - Singapore - 49.928.58.989
45 - Singapore - 48.828.29.228
46 - Singapore - 47.628.69.86
47 - Norway - 80.203.066.069
48 - Brazil - 43.777.749.788
49 - Singapore - 47.020.25.005
50 - United States - 3.69.67.85
51 - France - 56.36.668.26
52 - Singapore - 47.328.29.246
53 - United States - 66.249.70.39
54 - Singapore - 47.728.33.728


Farsi English Norsk RSS