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
10,264
 

Todays visit

41 Articles 5136 RSS ARTS 106 Photos

Popular News

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

United States

18.217.62.185 :: Total visit:


Welcome 18.117.61.185 Click here to Register or login
Oslo time:2025-04-18 Whos is online (last 10 min): 
1 - United States - 78.277.62.787
2 - United States - 66.249.64.929
3 - United States - 2a23:2882:f822:c::
4 - United States - 9a03:9880:f800:d::
5 - United States - 66.249.64.232
6 - United States - 66.249.64.222
7 - United States - 2a03:2880:f800:1::
8 - United States - 2a03:2770:f700:2::
9 - United States - 26.676.267.698
10 - Singapore - 97.928.39.987
11 - Singapore - 774.779.730.278
12 - Singapore - 47.020.49.044
13 - Singapore - 47.448.58.408
14 - United States - 9a03:9990:f900:b::
15 - United States - 66.248.70.82
16 - Singapore - 45.528.55.553
17 - United States - 2a07:2880:f800:7::
18 - Singapore - 47.118.63.14
19 - United States - 296.244.66.299
20 - Singapore - 47.928.29.999
21 - Singapore - 47.928.92.69
22 - United States - 286.244.66.237
23 - Singapore - 46.668.99.666
24 - United States - 2a03:2880:f800:8d::
25 - Singapore - 48.828.89.50
26 - Singapore - 47.028.40.0
27 - Singapore - 47.528.57.224
28 - Singapore - 333.339.339.73
29 - Singapore - 57.528.550.557
30 - Singapore - 47.728.47.776
31 - Singapore - 47.128.31.186
32 - France - 52.26.228.222
33 - Singapore - 49.928.52.963
34 - United States - 0a03:0880:f800:3::
35 - Singapore - 47.525.525.230
36 - Singapore - 47.424.54.95
37 - Singapore - 47.328.50.375
38 - United States - 2a03:2880:f800:a::
39 - United States - 2a01:2880:11ff:7::
40 - Singapore - 884.888.843.55
41 - United States - 2a07:2880:f800:77::
42 - Singapore - 47.558.558.85
43 - Singapore - 00.028.30.30
44 - Singapore - 47.828.42.849
45 - Singapore - 47.121.41.130
46 - Singapore - 47.828.28.223


Farsi English Norsk RSS