Integer Coercion
Cast passed value into a PHP int type.
Input Value | Output Result | Description |
|---|---|---|
|
| Returns int value "as is" |
|
| Returns the value of the int backed enum case |
|
| Converts string to an integer value [1] |
|
| Converts float to an integer value [2] |
|
| |
|
| |
|
| |
Other |
| Throws |
Notes
The string value must satisfy the following rules:
Must be non-empty
Must contain integer-like numeric value or must float-like allowing casting without loss of accuracy [2]
The float value must satisfy the following rules:
Must not be more than
PHP_INT_MAXMust not be less than
PHP_INT_MINThe mantissa should be
0(should be no loss of precision)
05 November 2025