Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94227 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58100 invoked from network); 23 Jun 2016 14:11:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jun 2016 14:11:31 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.180 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.192.180 mail-pf0-f180.google.com Received: from [209.85.192.180] ([209.85.192.180:34051] helo=mail-pf0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C0/00-58020-21EEB675 for ; Thu, 23 Jun 2016 10:11:30 -0400 Received: by mail-pf0-f180.google.com with SMTP id h14so29225137pfe.1 for ; Thu, 23 Jun 2016 07:11:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:references:from:to:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=94lAnLsNPmajsWLNAkYaTILFUCwvjm5w8M8oHYaoDZE=; b=PrG4id4M6LArumGgJHASMc9S6MfrJAGrq5rnrsYMq0jn5CVo5gjX5/0W7gN/QVRG22 nBLJd5TEEaUBjD0jF8US6in0FcKGJQKUZZ7pN61GQEfUlrbeg4Lwl8CDmUuisQOaIVzn h/zsxzAiQWdl9ahE9MWkxm/fohoOZ8dFmh2H2gBvjD+nM+90GxYeRikoZh6XCNLOHUO6 GFfu8E/Zj/J9xa2IzgsrIRCH2dbuGCae0DFamws4dYJIkSuTy47TTHkuT5IADhjsCeS7 pmhQc1dGCecUIMJsDYNmQDernv8u8okF+glrKfwnupPXYXXeU/3VS2vTT/vv98evfixs 1aSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:references:from:to:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=94lAnLsNPmajsWLNAkYaTILFUCwvjm5w8M8oHYaoDZE=; b=Nbpr9boCP9QvRKCOz0VoSpbhBTtZm1XD8FDucXH5285qghYPrBrYPlSQbKSvO0epuq zLyaGqrAQtiA68FxwThrZn1Lylax/LQa3uSFDGvzdZhQ/IghQ+ps0epl0SDIHsBmON+2 thvfMXFrAV/M6xEtEpmvrQzpV7YZbjSRCrJy1NQvvqmrCY4AXSiIV2QGfBiCsu/rbDu3 ESHaJN4I2sQcp9S3C5Z3yjwyyZhN2EahEDZjFuHl5trEVizOGIbZ4V/RJYQvPE+MIhzo KGqwubvxjmY7onRnUQto+j9nxVKkUz2gOSMyWyN+SiVQObQyeLdlDuvj/RFeT3uhmz7o bI7A== X-Gm-Message-State: ALyK8tJ6PMzwE6+hjEfSGq/tqEbx7pZ93aIDdx3x5h0ZzbvZ5m7xk5PtcVfBVARlFJzKag== X-Received: by 10.98.89.147 with SMTP id k19mr43197027pfj.156.1466691086542; Thu, 23 Jun 2016 07:11:26 -0700 (PDT) Received: from [192.168.0.98] ([93.188.182.58]) by smtp.gmail.com with ESMTPSA id 186sm548384pfg.39.2016.06.23.07.11.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jun 2016 07:11:25 -0700 (PDT) References: <2f92fa26-5f50-0e68-c1fc-de79f17c201e@fleshgrinder.com> <8b48f847-bbba-03f8-4b2e-9cd0841b484e@gmail.com> <65ea0142-c2d6-f4ed-e98e-b7c7fbc51c58@fleshgrinder.com> To: PHP internals Message-ID: Date: Thu, 23 Jun 2016 15:09:12 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] RNG fixes From: rowan.collins@gmail.com (Rowan Collins) On 23/06/2016 14:57, Nikita Popov wrote: > Whatever we do, please maintain the invariant that mt_rand() >= rand() > in terms of quality. I recommend doing this by making mt_rand() == rand(). The relationship that I feel is poorly defined at the moment is random_int() vs mt_rand(). There isn't actually anything in the manual to say when *not* to use it. So the implication seems to be random_int() > mt_rand() > rand(). I would prefer something like random_fast_int() == mt_rand() == rand(), with clear documentation on when to use random_fast_int() instead of random_int(), and a note on the others that "since 7.2, mt_rand() is an alias for random_fast_int()" etc. (Not wedded to the name random_fast_int, we can bikeshed that later.) Regards, -- Rowan Collins [IMSoP]