CakeFest 2024: The Official CakePHP Conference

Random\Randomizer::getInt

(PHP 8 >= 8.2.0)

Random\Randomizer::getIntGet a uniformly selected integer

Descrição

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

Aviso

Esta função não está documentada; apenas a lista de argumentos está disponível.

Parâmetros

min

The lowest value to be returned.

max

The highest value to be returned.

Valor Retornado

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

Erros/Exceções

Exemplos

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

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

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

O exemplo acima produzirá algo semelhante a:

42

Veja Também

add a note

User Contributed Notes

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