diff --git a/src/Generator.php b/src/Generator.php index ee01a41e94..0890778ea2 100644 --- a/src/Generator.php +++ b/src/Generator.php @@ -687,10 +687,22 @@ public function seed($seed = null) if ($seed === null) { mt_srand(); } else { - mt_srand((int) $seed, MT_RAND_PHP); + mt_srand((int) $seed, self::mode()); } } + /** + * @see https://www.php.net/manual/en/migration83.deprecated.php#migration83.deprecated.random + */ + private static function mode(): int + { + if (PHP_VERSION_ID < 80300) { + return MT_RAND_PHP; + } + + return MT_RAND_MT19937; + } + public function format($format, $arguments = []) { return call_user_func_array($this->getFormatter($format), $arguments);