You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spec/05-types.md
+12-13
Original file line number
Diff line number
Diff line change
@@ -58,23 +58,22 @@ The library function `is_bool` (§xx) indicates if a given value has type
58
58
###The Integer Type
59
59
60
60
There is one integer type, `int`, for which the name `integer` is a synonym.
61
-
This type is binary, signed, and uses twos-complement representation for
62
-
negative values. The range of values that can be stored is
63
-
implementation-defined; however, the range [-2147483648, 2147483647],
64
-
must be supported. This range must be finite.
61
+
This type is a binary, signed, arbitrary-precision integer. Its range is
62
+
limited only by available memory.
65
63
66
-
Certain operations on integer values produce a mathematical result that
67
-
cannot be represented as an integer. Examples include the following:
64
+
Implementations MAY choose to implement this type with an underlying native
65
+
integer type and a separate arbitrary-precision integer type, switching between
66
+
the two types as and where appropriate, so long as the observed behaviour is
67
+
identical and the two types are indistinguishable, i.e. they are, for all
68
+
intents and purposes, the same type and are reported as such.
68
69
69
-
- Incrementing the largest value or decrementing the smallest value.
70
-
- Applying the unary minus to the smallest value.
71
-
- Multiplying, adding, or subtracting two values.
72
-
73
-
In such cases, the computation is done as though the types of the values were
74
-
`float` with the result having that type.
70
+
Bitwise operations MUST use two's-complement arithmetic, however implementations
71
+
MAY choose not to use a two's-complement underlying representation.
75
72
76
73
The constants `PHP_INT_SIZE` (§[[6.3](06-constants.md#core-predefined-constants)](#core-predefined-constants)), `PHP_INT_MAX` (§[[6.3](06-constants.md#core-predefined-constants)](#core-predefined-constants)) and `PHP_INT_MIN` (§[[6.3](06-constants.md#core-predefined-constants)](#core-predefined-constants))
77
-
define certain characteristics about type `int`.
74
+
exist for backwards-compatibility reasons, and indicate the native integer
75
+
size of the machine (usually 32-bit or 64-bit). They do not, however, represent
76
+
the actual range and size of the PHP integer type, which is unlimited.
78
77
79
78
The library function `is_int` (§xx) indicates if a given value has type
Copy file name to clipboardExpand all lines: spec/06-constants.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -106,9 +106,9 @@ Constant Name | Description
106
106
`PHP_EOL` | `string`; the end-of-line terminator for this platform.
107
107
`PHP_EXTENSION_DIR` | `string`; The directory to be searched by the library function dl (§xx) when looking for runtime extensions.
108
108
`PHP_EXTRA_VERSION` | `string`; the current PHP extra version.
109
-
`PHP_INT_MAX` | `int`; the maximum representable value for an integer.
110
-
`PHP_INT_MIN` | `int`; the minimum representable value for an integer.
111
-
`PHP_INT_SIZE` | `int`; the number of bytes used to represent an integer.
109
+
`PHP_INT_MAX` | `int`; the maximum representable value for a native integer on this platform. (This does not correspond to the maximum size of a PHP integer, unlimited.)
110
+
`PHP_INT_MIN` | `int`; the minimum representable value for a native integer on this platform. (This does not correspond to the maximum size of a PHP integer, which is unlimited.)
111
+
`PHP_INT_SIZE` | `int`; the number of bytes used to represent the native integer size of this platform. (This does not correspond to the maximum size of a PHP integer, which is unlimited.)
112
112
`PHP_MAJOR_VERSION` | `int`; the current PHP major version
113
113
`PHP_MANDIR` | `string`; the installation location of the manual pages.
114
114
`PHP_MAXPATHLEN` | `int`; the maximum length of a fully qualified filename supported by this build.
0 commit comments