PHP 8.1.28 Released!

Random\Randomizer::getInt

(PHP 8 >= 8.2.0)

Random\Randomizer::getIntGet a uniformly selected integer

Beschreibung

public Random\Randomizer::getInt(int $min, int $max): int

Warnung

Diese Funktion ist bis jetzt nicht dokumentiert. Es steht nur die Liste der Parameter zur Verfügung.

Parameter-Liste

min

The lowest value to be returned.

max

The highest value to be returned.

Rückgabewerte

A uniformly selected integer from the closed interval [min, max]. Both min and max are possible return values.

Fehler/Exceptions

Beispiele

Beispiel #1 Random\Randomizer::getInt() example

<?php
$r
= new \Random\Randomizer();

// Random integer in range:
echo $r->getInt(1, 100), "\n";
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

42

Siehe auch

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top