PHP: Hypertext Preprocessor (original) (raw)
Random\Randomizer::getInt
(PHP 8 >= 8.2.0)
Random\Randomizer::getInt — Get a uniformly selected integer
Description
public Random\Randomizer::getInt(int $min
, int $max
): int
Warning
This function is currently not documented; only its argument list is available.
Parameters
min
The lowest value to be returned.
max
The highest value to be returned.
Return Values
A uniformly selected integer from the closed interval [min
, max
]. Bothmin
and max
are possible return values.
Examples
Example #1 Random\Randomizer::getInt() example
<?php $r = new \Random\Randomizer();// Random integer in range: echo $r->getInt(1, 100), "\n"; ?>
The above example will output something similar to:
See Also
- random_int() - Get a cryptographically secure, uniformly selected integer
- Random\Randomizer::getFloat() - Get a uniformly selected float
Found A Problem?
There are no user contributed notes for this page.