Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80392 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45419 invoked from network); 12 Jan 2015 00:26:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Jan 2015 00:26:44 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.199 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.199 imap11-2.ox.privateemail.com Received: from [192.64.116.199] ([192.64.116.199:33519] helo=imap11-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D5/F1-34383-3C413B45 for ; Sun, 11 Jan 2015 19:26:44 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 0334F8800A2; Sun, 11 Jan 2015 19:26:40 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at imap11.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap11.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id poSgk95wEs7A; Sun, 11 Jan 2015 19:26:39 -0500 (EST) Received: from oa-res-26-240.wireless.abdn.ac.uk (oa-res-26-240.wireless.abdn.ac.uk [137.50.26.240]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 760F28800E7; Sun, 11 Jan 2015 19:26:39 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) In-Reply-To: Date: Mon, 12 Jan 2015 00:26:37 +0000 Cc: PHP Internals List Content-Transfer-Encoding: quoted-printable Message-ID: <9714C869-9DD0-4C7A-B740-4A2AF2497ED6@ajf.me> References: To: Leigh X-Mailer: Apple Mail (2.1993) Subject: Re: [PHP-DEV] rand(), mt_rand() and limits From: ajf@ajf.me (Andrea Faulds) Hey Leigh, > On 12 Jan 2015, at 00:23, Leigh wrote: >=20 > On 11 January 2015 at 22:12, Andrea Faulds wrote: >> * Get rid of rand(), srand() and getrandmax() >> * Rename mt_rand(), mt_srand() and mt_getrandmax() to rand(), = srand(), and getrandmax() but add mt_* aliases for = backwards-compatibility >> * Make mt_srand() and srand() do nothing and produce a deprecation = notice >> * Use a 64-bit random number generation algorithm on 64-bit = platforms (or invoke the 32-bit generator twice) >>=20 >=20 > I have to object to removing the C stdlib rand(). mt_rand() is > significantly slower and when I don't care about the "quality" of the > random numbers the choice is obvious. For what application do you need to generate so many random numbers that = mt_rand() is too slow? Bear in mind that rand() is only faster if = you=E2=80=99re using a sdtlib that=E2=80=99s faster. Thanks. -- Andrea Faulds http://ajf.me/