PHP Conference Japan 2024

Random\Randomizer 類別

(PHP 8 >= 8.2.0)

簡介

提供由 Random\Engine 提供的隨機性之高階 API。

類別概要

final class Random\Randomizer {
/* 屬性 */
public readonly Random\Engine $engine;
/* 方法 */
public __construct(?Random\Engine $engine = null)
公開 getBytes(整數 $length): 字串
公開 getBytesFromString(字串 $string, 整數 $length): 字串
公開 getFloat(浮點數 $min, 浮點數 $max, Random\IntervalBoundary $boundary = Random\IntervalBoundary::ClosedOpen): 浮點數
公開 getInt(整數 $min, 整數 $max): 整數
公開 nextInt(): 整數
公開 pickArrayKeys(陣列 $array, 整數 $num): 陣列
公開 shuffleArray(陣列 $array): 陣列
公開 shuffleBytes(字串 $bytes): 字串
公開 __unserialize(陣列 $data):
}

屬性

engine

Random\Randomizer 方法的底層隨機性來源。

目錄

新增註解

使用者貢獻的註解

此頁面沒有使用者貢獻的註解。
To Top