Random\Randomizer::nextInt

(PHP 8 >= 8.2.0)

Random\Randomizer::nextIntGet a positive integer

说明

public Random\Randomizer::nextInt(): int

警告

本函数还未编写文档,仅有参数列表。

参数

此函数没有参数。

返回值

A positive integer between 0 and a maximum value depending on the number of bytes returned from Random\Engine::generate(). The exact maximum can be calculated as 2$engine_bytes * 8 - 1 - 1.

错误/异常

示例

示例 #1 Random\Randomizer::nextInt() example

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

// Random "next" integer:
echo $r->nextInt(), "\n";
?>

以上示例的输出类似于:

8041689838856078718
add a note add a note

User Contributed Notes

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