Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75601 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 37532 invoked from network); 16 Jul 2014 20:29:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jul 2014 20:29:41 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.45 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.215.45 mail-la0-f45.google.com Received: from [209.85.215.45] ([209.85.215.45:62362] helo=mail-la0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 23/00-37298-3B0E6C35 for ; Wed, 16 Jul 2014 16:29:40 -0400 Received: by mail-la0-f45.google.com with SMTP id ty20so1051585lab.18 for ; Wed, 16 Jul 2014 13:29:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=uiCsc8QFODumvtU5BHtOk82oJB0dWGu7AfAz9t4+CNc=; b=MCv8de2ZPZHhemw/GaQQ+WadI4EEIjQ+42gOh6PMscBnCD/2KufzaSE9VWNSauvdFC Je8O3j2zqISC+Diq8twCe/v9vz4Jxe433IpL9TkxEZfilQqj+1jxY87GWcXRE9V8wybi 8+mtTnQHupo9kN96JiSZkE5W0NEvDNiDxkcOgDj8auTjKXcVuen9FD/EknGunMgL/EOn mTzouKmtbGbfZg4aD5nnO/z3Kq3uaFG/SObVTymrf/IF96P71jkDc8BkelXJvVkc2flG UDhbi1SEjStqtwH2Hc9X1qPbiER8azgYcth28HlYFuoMpaU37AA2Y4REkVGnSDgCrBDS nG6Q== X-Received: by 10.112.167.105 with SMTP id zn9mr26247143lbb.10.1405542575542; Wed, 16 Jul 2014 13:29:35 -0700 (PDT) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.128.202 with HTTP; Wed, 16 Jul 2014 13:28:55 -0700 (PDT) In-Reply-To: <408D7421-502D-4113-80AA-CC244412A60F@ajf.me> References: <53C6BCD2.4020605@gmail.com> <408D7421-502D-4113-80AA-CC244412A60F@ajf.me> Date: Thu, 17 Jul 2014 05:28:55 +0900 X-Google-Sender-Auth: tVhIaV3f4L0ynykjYxQ0hA_SRvs Message-ID: To: Andrea Faulds Cc: Rowan Collins , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11c25eb0ee973904fe5561f9 Subject: Re: [PHP-DEV] Use of php_mt_rand() rather than php_rand() From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11c25eb0ee973904fe5561f9 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, On Thu, Jul 17, 2014 at 3:00 AM, Andrea Faulds wrote: > > Do you propose making rand() a synonym for mt_rand()? If so, wouldn't i= t > make sense for srand() to become a synonym for mt_srand()? > > Whether that=E2=80=99s what Yasuo proposes or not, I=E2=80=99d like to se= e this. It=E2=80=99s > rather silly that rand() isn=E2=80=99t the proper one, and that mt_rand()= is. We > could always rename rand() to legacy_rand() or something. I wasn't intended to use MT rand for rand() as the bug report suggests ( https://bugs.php.net/bug.php?id=3D66718) Having mt_shuffle(), mt_whatever() would not be a good idea. IMO. Making MT rand the default everywhere is valid choice. Almost all codes that use rand()/mt_rand() expect true randomness even if they are not. I'll add rand() rename option for upcoming RFC. rand() to lagacy_rand()/rand_legacy()/rand_system(), perhaps? The name can be any. Suggestions are appreciated. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11c25eb0ee973904fe5561f9--