Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85790 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82051 invoked from network); 13 Apr 2015 20:06:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Apr 2015 20:06:57 -0000 Authentication-Results: pb1.pair.com smtp.mail=cmbecker69@gmx.de; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=cmbecker69@gmx.de; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmx.de designates 212.227.17.22 as permitted sender) X-PHP-List-Original-Sender: cmbecker69@gmx.de X-Host-Fingerprint: 212.227.17.22 mout.gmx.net Received: from [212.227.17.22] ([212.227.17.22:55283] helo=mout.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 47/C5-41712-FD12C255 for ; Mon, 13 Apr 2015 16:06:56 -0400 Received: from [192.168.0.101] ([88.134.68.210]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0MM0bQ-1YisgS2D40-007ljM; Mon, 13 Apr 2015 22:06:52 +0200 Message-ID: <552C21E0.5070507@gmx.de> Date: Mon, 13 Apr 2015 22:06:56 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Rowan Collins , internals@lists.php.net References: <2FECEA44-6299-4984-8789-C0A107D88C4B@gmail.com> <552B36C7.7080102@gmail.com> <552B936E.1070804@gmail.com> In-Reply-To: <552B936E.1070804@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:/RiosnPYk5cZaCe+TvLTmi4UVYRENt5wWsiVaCNXH6ukMI1j7I4 MsGhzA0j1VTxJOjNnwx3brmmAc6/qcJVYEPztFeh1TtEtu2rPSoe5bLtm8QGr3QKHdhJEig Dq6FJhNQSGpx0CasutVXA6iMOW2N+AAQS7C0ydNPxD8n540IHHkJupWnqsxe9BNtt3TH74w wevhnzyPlEN7c/3/gYNVA== X-UI-Out-Filterresults: notjunk:1; Subject: Re: [PHP-DEV] $max > getmaxrand() for rand() call From: cmbecker69@gmx.de (Christoph Becker) Rowan Collins wrote: > To be fair, that's not actually mutually exclusive with Leszek's > suggestions - we still need to either document, or warn, that rand() has > this limitation. The manual does actually mention using mt_rand(), but > also suggests setting $max higher than getrandmax(), which is probably > bad advice: > >> If you require a range larger than 32767, specifying |min| and |max| > will allow you to create a range larger than this, or consider using > mt_rand() instead. It seems to be noteworthy that the mt_rand man page contains a respective warning[1], and the mt_getrandmax man page explains the issue in the "Return Values" section[2]. I think it would be reasonable to document rand/getrandmax alike in this regard. [1] [2] -- Christoph M. Becker