[DOC-CVS] [doc-en] master: random: clarify that `getrandmax` was small only before PHP 7.1 (#4664)

[email protected] (Takuya Aramaki via GitHub)
Newsgroups php.doc.cvs
Message-ID <[email protected]>
Author: Takuya Aramaki (takaram)
Committer: GitHub (web-flow)
Pusher: TimWolla
Date: 2025-05-08T18:36:07+02:00

Commit: https://github.com/php/doc-en/commit/bf672f5f2402ee78264a130c52defeed37fe44bf
Raw diff: https://github.com/php/doc-en/commit/bf672f5f2402ee78264a130c52defeed37fe44bf.diff

random: clarify that `getrandmax` was small only before PHP 7.1 (#4664)

Since PHP 7.1 `getrandmax` is an alias of `mt_getrandmax`,
which returns 2**31 - 1

Changed paths:
  M  reference/random/functions/rand.xml


Diff:

diff --git a/reference/random/functions/rand.xml b/reference/random/functions/rand.xml
index e9d821b16211..9009f221f478 100644
--- a/reference/random/functions/rand.xml
+++ b/reference/random/functions/rand.xml
@@ -27,8 +27,8 @@
   &caution.cryptographically-insecure;
   <note>
    <simpara>
-    On some platforms (such as Windows), <function>getrandmax</function>
-    is only 32767.  If you require a range larger than 32767, specifying
+    Prior to PHP 7.1.0, <function>getrandmax</function> was only 32767 on some
+    platforms (such as Windows). If you require a range larger than 32767, specifying
     <parameter>min</parameter> and <parameter>max</parameter> will allow
     you to create a range larger than this, or consider using
     <function>mt_rand</function> instead.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.