Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94955 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34727 invoked from network); 8 Aug 2016 21:36:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Aug 2016 21:36:46 -0000 Authentication-Results: pb1.pair.com smtp.mail=leight@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=leight@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.66 as permitted sender) X-PHP-List-Original-Sender: leight@gmail.com X-Host-Fingerprint: 74.125.82.66 mail-wm0-f66.google.com Received: from [74.125.82.66] ([74.125.82.66:35884] helo=mail-wm0-f66.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 76/9A-33134-C6BF8A75 for ; Mon, 08 Aug 2016 17:36:46 -0400 Received: by mail-wm0-f66.google.com with SMTP id i138so456230wmf.3 for ; Mon, 08 Aug 2016 14:36:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=HX5iYGO+CRlJL4SluIa0EE8mqOkmj0NryWFR0qQs/6U=; b=MVRg3QNc/juy9HXAWJe7NYm6ulCywhLp2wUf15KLZqYjO21cfB0MDtK0UUkRmuf70b aRsI8ld6c9bwfOyC+df5AXRqIIiAa7N5VaWH8I9SNeDdDTwqE8DzhNpu2nCgzozhyeOT 5eqBnQ6aS4eGcn1CoYbrlqgda0axFCUIsnO85yKp5HMyblrNdo87Vy/Qv9Oi8QyYLuXN OVqzhwQQbWn3IuaDNvmDMMrsLEdtqpWxwujEF+narGADOP4YpdUrvJI8FisS9pRcY8bn nIvnGc9fE5AdsAHc42s4axJWlIGIulD25J/8CBxi+jHX9KrLtxBH11v3xXkTpeNET2jX Pu6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=HX5iYGO+CRlJL4SluIa0EE8mqOkmj0NryWFR0qQs/6U=; b=NordznWnBQHxrac7qf8RTwxeX6SEqVo5JijAASzw+pt9F4I27zvJQnMdpG51/xLeDu c7+yJJDiRMfskmWwxTuNospLDzyFDPpK2YCdHOOTqI72EqeQ96f4vPrHLn14XXXyrMq0 CeCQPjN/l1plK1x82oWLo+Jmz59eH3hnxUBoSbjQ2JK/pogFx0bfuG3yOdGwsXNo5hoW otZ+67phQfa/ZHA7KBI9eXDBW4t9fbP3zzxeClWEoBpGB90uB0K2Xp+KY9htnJuhddiv SJXYhX8UHpLqsRTq//qQFsOTy1x+7ScErJdC2LQgxMz6naUX1nnFBmJsnDpex0NfGdO6 W18g== X-Gm-Message-State: AEkooutRGcg1zzqLKU4p/+XfbwBZXjw0Z9Mv436Vb0rCwYv1CvdA2vfn3qZg21yAg/for0+m3nxAMYZh6E9/fQ== X-Received: by 10.25.166.2 with SMTP id p2mr24201402lfe.134.1470692201064; Mon, 08 Aug 2016 14:36:41 -0700 (PDT) MIME-Version: 1.0 Date: Mon, 08 Aug 2016 21:36:30 +0000 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=001a11411d6637f06905399636a4 Subject: BC break with rand() where min > max From: leight@gmail.com (Leigh) --001a11411d6637f06905399636a4 Content-Type: text/plain; charset=UTF-8 Hi all, There has been an unforeseen break with rand() when the minimum value is greater than the maximum. Prior to 7.1 rand() would happily accept backwards parameters and return a value, however in the 7.1 branch it now emits a warning and returns false. I've preemptively committed a fix to allow min > max and return a value as in previous versions, but have kept the warning. Looking for some feedback/opinions on whether anyone else thinks this should be fixed differently (or not at all). N.B. this also changes the behaviour of mt_rand to now accept min > max --001a11411d6637f06905399636a4--