Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86211 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35025 invoked from network); 14 May 2015 08:55:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 May 2015 08:55:49 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.172 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.212.172 mail-wi0-f172.google.com Received: from [209.85.212.172] ([209.85.212.172:38498] helo=mail-wi0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 38/54-31470-21364555 for ; Thu, 14 May 2015 04:55:47 -0400 Received: by wicnf17 with SMTP id nf17so85940394wic.1 for ; Thu, 14 May 2015 01:55:43 -0700 (PDT) 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=JdpLJ6oUD1k02aac3vLo13v+fnVjOd5PdYkLqYHBy7Y=; b=pTxinc59jOBEeXqdCx+7i4tKO4rSTMuZEAUKVPpu13+d6LiGsfrH5HuDA7Kamg0vpo u4McuLkugZp1jBFr4GCyotByl6g2v8rWk8Cvc6aauCc1y3NawpvhD/ifKyo7yYxw8041 zimxcSfbNl5ecp/84L+P93GFdh+lRiqBIgEG8aAcZpeWjVM2J2kNOHoH3SuhERf3LYez ueXq/9UQk+dMLtkvowWi+lhKsmHCI+UbC2DweCYlINkHZpeKjhrz85GKmZvv6w+q9Vpp SFvXJoZf2XImwhKYQMKg3Aav1UoI9e8TeJSxEQx0mY8uoWX5JkvhXn+NLdMQkQC6F1DI mG4w== MIME-Version: 1.0 X-Received: by 10.180.79.227 with SMTP id m3mr47137609wix.71.1431593743243; Thu, 14 May 2015 01:55:43 -0700 (PDT) Received: by 10.27.86.133 with HTTP; Thu, 14 May 2015 01:55:43 -0700 (PDT) In-Reply-To: References: Date: Thu, 14 May 2015 10:55:43 +0200 Message-ID: To: Yasuo Ohgaki Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=14dae9cc9f96875ca2051606e414 Subject: Re: [PHP-DEV] mt_rand() behavior change is not in UPGRADING From: nikita.ppv@gmail.com (Nikita Popov) --14dae9cc9f96875ca2051606e414 Content-Type: text/plain; charset=UTF-8 On Thu, May 14, 2015 at 10:13 AM, Yasuo Ohgaki wrote: > Hi all, > > It's nice to see mt_rand() behavior is improved. > > [yohgaki@dev ~]$ php-5.6 -r "var_dump(mt_rand(222, > '99999999999999999999999'));" > int(115282844144104926) > [yohgaki@dev ~]$ php-7.0 -r "var_dump(mt_rand(222, > '99999999999999999999999'));" > > Warning: mt_rand() expects parameter 2 to be integer, string given in > Command line code on line 1 > NULL > > However, returning NULL for invalid range may result in serious issues. > It's not documented in UPGRADING. > > Could anyone responsible take care of it? > I suppose mt_srand() behavior has changed also. > There may be others. > This change is not mt_rand specific, it applies to all internal functions. See https://wiki.php.net/rfc/zpp_fail_on_overflow. You are right that it is not mentioned in UPGRADING yet. Nikita --14dae9cc9f96875ca2051606e414--