Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:72773 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84611 invoked from network); 23 Feb 2014 19:08:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Feb 2014 19:08:44 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.53 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.219.53 mail-oa0-f53.google.com Received: from [209.85.219.53] ([209.85.219.53:56863] helo=mail-oa0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 40/C3-57053-B374A035 for ; Sun, 23 Feb 2014 14:08:43 -0500 Received: by mail-oa0-f53.google.com with SMTP id o6so1140622oag.12 for ; Sun, 23 Feb 2014 11:08:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=xVGloHyQowVnIUi4pBPnAT1I8gG9Qte+ODzGZUxM3jE=; b=r7eYzwMj+QHiK/06p79Ur15Z9n0PRJcH1p3MQ9kwGOC2ZJUcOmLoM2AI22oung5eQT ynnE7ivIN1FEgv85GU/W9s2EZnedFjVzYAtuOmM2eN/hQIdlnbmtpvWRBB9I/oQ0xSYO 76UnuQVC1PCtTlHQcObbDZ3x3pSXKb6asjSTH25u5Qu20er89UtCAu4bVv/ejB4gwTJQ 5cq7ucAoNFHc4k66gKYCRYoZueBNhAPEeqsy4vutg22Xz5E67ylQE5/WCnfGCucT+qQG nCkzitCMbDTpPJPM8I95V5AlUgfba6um0jxroePzWY8S9T8mpr655yBF9zrfaJMma6Qu L80Q== MIME-Version: 1.0 X-Received: by 10.60.63.11 with SMTP id c11mr18665101oes.82.1393182519419; Sun, 23 Feb 2014 11:08:39 -0800 (PST) Received: by 10.182.54.112 with HTTP; Sun, 23 Feb 2014 11:08:39 -0800 (PST) In-Reply-To: References: Date: Sun, 23 Feb 2014 20:08:39 +0100 Message-ID: To: =?ISO-8859-1?Q?Rouven_We=DFling?= Cc: PHP internals Content-Type: multipart/alternative; boundary=001a11c20c542d69be04f3179534 Subject: Re: [PHP-DEV] [PHP6] Merging rand and mt_rand() From: nikita.ppv@gmail.com (Nikita Popov) --001a11c20c542d69be04f3179534 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Sun, Feb 23, 2014 at 7:45 PM, Rouven We=DFling wro= te: > Hello internals, > > there has already been a lot of talk about improving secure random number > generation for PHP6. One thing I'd like to improve as well, would be > non-secure random number generation. Here is not so much security at stak= e > but ease of use. > > The obvious solution, would be to rename mt_rand to rand and make rand an > alias. (The same for the supporting functions mt_srand and mt_getrandmax)= . > > What I'm missing is the history. What was the reason to keep the separate= ? > Am I missing something? > > Best regards > Rouven > Changing the random number generation algorithm is a BC break, e.g. tests could rely on certain random number sequences for a certain seed. However it sounds reasonable to make rand, array_shuffle, str_shuffle etc make use of MT 19937 in PHP6, as we have a bit more freedom with breakage. Nikita --001a11c20c542d69be04f3179534--