What is the meaning of int in php
This article mainly introduces the meaning of int in php, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
In php, int refers to the Integer integer, and int is a number in the set "ℤ= {,-2,-1, 0, 1, 2,.}". The integer value int can be expressed in decimal, hexadecimal, octal or binary, such as "$a = 1234;".
This article operating environment: Windows7 system, PHP7.1 version, DELL G3 computer
What is the meaning of int in php?
Integer integer
Int is a number in the set ℤ= {,-2,-1, 0, 1, 2,.}.
Grammar
The integer value int can be expressed in decimal, hexadecimal, octal, or binary, preceded by an optional symbol (- or +). You can use a negative operator to represent a negative int.
To use octal representation, the number must be preceded by 0 (zero). Since PHP 8.1.0, octal expressions can also be preceded by 0o or 0O. To use hexadecimal representation, the number must be preceded by 0x. To use a binary representation, the number must be preceded by 0b.
Starting with PHP 7.4.0, integer values may include underscores (_), which are filtered out by PHP when displayed for a better reading experience.
Example # 1 Integer text representation
The structural form of int syntax is (underscores are not supported before PHP 7.4.0):
Decimal: [1-9] [0-9] * (_ [0-9] +) * | 0hexadecimal: 0 [xX] [0-9a-fA-F] + (_ [0-9a-fA-F] +) * octal: 0 [oO]? [0-7] + (_ [0-7] +) * binary: 0 [bB] [01] + (_ [01] +) * integer: decimal | | hexadecimal | octal | binary |
The word length of the integer int is platform-dependent, although the usual maximum value is about 2 billion (32-bit signed). The maximum value on a 64-bit platform is usually about 9E18. PHP does not support unsigned int. The word length of the int value can be expressed as a constant PHP_INT_SIZE, the maximum value can be expressed as a constant PHP_INT_MAX, and the minimum value can be expressed as a constant PHP_INT_MIN.
Thank you for reading this article carefully. I hope the article "what is the meaning of int in php" shared by the editor will be helpful to you. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!