Skip to content

Conversation

@Girgias
Copy link
Member

@Girgias Girgias commented Dec 28, 2025

As all the other rand like functions are marked as aliases of the mt_* variants.

@Girgias Girgias marked this pull request as ready for review December 29, 2025 03:25
Copy link
Member

@TimWolla TimWolla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are not equivalent. rand() accepts the parameters in reverse order: https://3v4l.org/OpGqW

This is also documented in https://www.php.net/manual/en/function.rand.php

Note: As of PHP 7.1.0, rand() uses the same random number generator as mt_rand(). To preserve backwards compatibility rand() allows max to be smaller than min as opposed to returning false as mt_rand().


function mt_rand(int $min = UNKNOWN, int $max = UNKNOWN): int {}

/* @alias mt_rand */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also not a proper docblock (missing asterisk). I don't think this had an effect based on the arginfo diff, otherwise CI should hopefully have caught it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants