Function __global->random_int
Definitions
sources_custom/phpstub.php
- Generates cryptographically secure pseudo-random integers.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: int
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $min | integer | No | No | required parameter | N/A | N/A | The lowest value to be returned, which must be PHP_INT_MIN or higher |
| $max | integer | No | No | required parameter | N/A | N/A | The highest value to be returned, which must be less than or equal to PHP_INT_MAX |
Returns
- A cryptographically secure random integer in the range min to max, inclusive
- Type: integer
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Generates cryptographically secure pseudo-random integers.
*
* @param integer $min The lowest value to be returned, which must be PHP_INT_MIN or higher
* @param integer $max The highest value to be returned, which must be less than or equal to PHP_INT_MAX
* @return integer A cryptographically secure random integer in the range min to max, inclusive
*/
function random_int(int $min, int $max) : int
* Generates cryptographically secure pseudo-random integers.
*
* @param integer $min The lowest value to be returned, which must be PHP_INT_MIN or higher
* @param integer $max The highest value to be returned, which must be less than or equal to PHP_INT_MAX
* @return integer A cryptographically secure random integer in the range min to max, inclusive
*/
function random_int(int $min, int $max) : int

