<?php
/* - - - - - - - - - - - - - - - - - - - - - - - -
A strictly numeric value
- - - - - - - - - - - - - - - - - - - - - - - - */
?>
GENERAL SPECIFICATIONS | ||
ID | THE SAME AS | IDENTIFYING |
INT | INTEGER | INTEGER NUMBERS |
INTEGER | ||
LONG | ||
FLOAT | FLOAT | DECIMAL NUMBERS |
DOUBLE | ||
REAL | ||
ed48 |
ABSOLUTE INTEGER VALUES | ||
#bit | MINIMUM | MAXIMUM |
8 | 0 | +255 |
16 | 0 | +65535 |
32 | 0 | +4294967295 |
64 | 0 | +18446744073709551615 |
ed48 |
INTEGER RELATIVE VALUES | ||
#bit | MINIMUM | MAXIMUM |
8 | −128 | +127 |
16 | −32768 | +32767 |
32 | −2147483648 | +2147483647 |
64 | −9223372036854775808 | +9223372036854775807 |
ed48 |
FLOAT VALUES | ||
#bit | MINIMUM | MAXIMUM |
64 | 2.2250738585072E-308 | 1.7976931348623E+308 |
ed48 |
<?php
/* - - - - - - - - - - - - - - - - - - - - - -
SOME NUMERIC INTERNAL
VARIABLE EXAMPLES
- - - - - - - - - - - - - - - - - - - - - -*/
$_SERVER['REQUEST_TIME'];
// The timestamp of the start of the request.
$_SERVER['REQUEST_TIME_FLOAT'];
// The timestamp, with precision in microseconds,
// from the beginning of the request
/* - - - - - - - - - - - - - - - - - - - - - - - - - -
If you run this exercise,
you will see that the semicolon
at the end of the VARIABLE name
avoids Parse error
- - - - - - - - - - - - - - - - - - - - - - - - - -*/
?>
<?php
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SOME NUMERIC USER-DEFINED
VARIABLE EXAMPLES
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
// INTEGER
$x01p = 220;
$x01n = -220;
// FLOAT
$x02p = 123.456;
$x02n = -123.456;
// CIENTIFIC NOTATION
$x03p = 1E19;
$x04p = 1.6e-19;
// HEXADECIMAL NOTATION ->
// -> (20b)base 16 = (20B)base 16 = (523)base 10
$x05p = 0x20b;
$x06p = 0X20B;
// OCTAL NOTATION ->
// -> (1023)base 8 = (531)base 10
$x07p = 01023;
// BINARY NOTATION
// -> (0011)base 2 = (3)base 10
$x08p = 0b0011;
// Available since PHP 5.4.0
// NUMERIC LITERALS CAN NOW CONTAIN UNDERSCORES
// PHP 7.4
$x09f = 5.567_076-10;
$x10d = 300_123_456;
$x11h = 0xAEAE_FADA;
// (AEAEFADA)base 16 = (2930703766)base 10
$x12b = 0b1110_0011;
// (11100011)base 2 = (227)base10
?>
<?php
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SOME NUMERIC INTERNAL
CONSTANT EXAMPLES
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
M_E;
// VALUE of e
M_PI;
// VALUE of PI
M_SQRT2;
// SQUARE ROOT of 2
/* - - - - - - - - - - - - - - - - - - - - - - - - - -
If you run this exercise,
you will see that the semicolon
at the end of the CONSTANT name
avoids Parse error
- - - - - - - - - - - - - - - - - - - - - - - - - -*/
?>