Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95030 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 71399 invoked from network); 10 Aug 2016 22:45:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Aug 2016 22:45:00 -0000 Authentication-Results: pb1.pair.com header.from=leight@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=leight@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.52 as permitted sender) X-PHP-List-Original-Sender: leight@gmail.com X-Host-Fingerprint: 74.125.82.52 mail-wm0-f52.google.com Received: from [74.125.82.52] ([74.125.82.52:35573] helo=mail-wm0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 19/31-61523-B6EABA75 for ; Wed, 10 Aug 2016 18:44:59 -0400 Received: by mail-wm0-f52.google.com with SMTP id f65so116251661wmi.0 for ; Wed, 10 Aug 2016 15:44:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=eZQT4JbNdNbSC8AYY+5ydc7cKHUVd6/jH0oMFWeuFJ8=; b=cHVnR48TzSY2gCJtrDP2NODpIazXxZtVpEZBznnLdxsyyMmCCn4/RKxAZ5ydUKUH9n K8wukzJTj7jq+cyX/TMxhxczlZ6IrSm94hP6yMFAKXPaUL0e0LDoOOk3A/Yj1ccgWafZ fa9ULSWuHMMCYCRw9ecJMw93earbh53+CQXQe4i1GY6DdCxpyK9nWMb20P80R+Wq8x1E AH+1yF7FQspYjrHDs8f5U0V8aygqBYNPfM3ZCCaix6Tn4t2Nkdcc4sDyJm1S+FK8yYY5 ye0mzFfXMTI/XismD3TimU+OSwGlYZ7M/8f6BiwKfjQdLnxLDVXVHsXMTnpoQ66CHgD1 JOJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=eZQT4JbNdNbSC8AYY+5ydc7cKHUVd6/jH0oMFWeuFJ8=; b=m8+juW6qSLLt42hKmnJjalEIq9WDhVoTH87oCFx9lcM8IOhgRIIobQqrjlzjdxg12K IDVRZC3ARcYihjxTvlPu/Y7r+aZwHNxqeMnXmML/1ZAwBq610d78rmV1bEPwex4dBV5H fu0xSNWfjcohKpKeu2MDRHAJ/11Hr1oviSZ6oxgx1sZ62s0VNPmeytDmWH6SdZkiTlsh 77tm1ncSLc3ToyhxwDWMm+6fa81j4j9PtehSDHXo6aox3Rdj4C03xEsUQ6fhVtJeprV3 HjaXEK46267P0TC0poIrFw+x+Cbnc79grzVlxkoHQLhgksm92r0GO+lmLfnrn881/Sol yGSA== X-Gm-Message-State: AEkoousUen7S0SmYxXm8BA1dvC/QS/zw5zOvSagscVfnh4xiTUMsRQPKymLDJaWGM/X2SQDOOzFO1Xpq6fwztA== X-Received: by 10.25.40.138 with SMTP id o132mr1054145lfo.221.1470869096552; Wed, 10 Aug 2016 15:44:56 -0700 (PDT) MIME-Version: 1.0 References: <069eeb79-5fa7-0c52-515c-8be836d6fce2@thefsb.org> In-Reply-To: <069eeb79-5fa7-0c52-515c-8be836d6fce2@thefsb.org> Date: Wed, 10 Aug 2016 22:44:45 +0000 Message-ID: To: Tom Worster , internals@lists.php.net Content-Type: multipart/alternative; boundary=001a1140232202df820539bf66c0 Subject: Re: BC break with rand() where min > max From: leight@gmail.com (Leigh) --001a1140232202df820539bf66c0 Content-Type: text/plain; charset=UTF-8 On Wed, 10 Aug 2016 at 14:19 Tom Worster wrote: > Your fix seems fine for rand() but less so for mt_rand(). > > Applying this fix will break much less mt_rand()-using code than not > applying it will break rand()-using code. From that point of view, > applying it is the better choice. > > Otoh, it's like copy-pasting a weird old bug from rand() to mt_rand(). > The plan was to make rand() alias mt_rand(). Now I'm not sure that's a > smart plan. > > Tom > I've pushed a fix that keeps the old behaviour for both I've un-aliased rand from mt_rand, added a min > max check to rand, and then call the common code with parameters reversed if necessary. --001a1140232202df820539bf66c0--