CakeFest 2024: The Official CakePHP Conference

Random\Randomizer::getInt

(PHP 8 >= 8.2.0)

Random\Randomizer::getIntGet a uniformly selected integer

Descripción

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

Advertencia

Esta función no está documentada actualmente, solamente se encuentra disponible la lista de parámetros.

Parámetros

min

The lowest value to be returned.

max

The highest value to be returned.

Valores devueltos

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

Errores/Excepciones

Ejemplos

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

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

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

El resultado del ejemplo sería algo similar a:

42

Ver también

add a note

User Contributed Notes

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