Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91504 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40495 invoked from network); 4 Mar 2016 18:37:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Mar 2016 18:37:41 -0000 X-Host-Fingerprint: 68.118.157.39 68-118-157-39.dhcp.mdsn.wi.charter.com Received: from [68.118.157.39] ([68.118.157.39:15286] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B5/B1-25279-5F5D9D65 for ; Fri, 04 Mar 2016 13:37:41 -0500 Message-ID: To: internals@lists.php.net References: <56C63A8A.3030809@gmail.com> <97CC6432-564B-4E28-B2DE-9C496FF1984D@zend.com> Date: Fri, 4 Mar 2016 12:37:36 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <97CC6432-564B-4E28-B2DE-9C496FF1984D@zend.com> Content-Type: text/plain; charset=windows-1255; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 68.118.157.39 Subject: Re: [PHP-DEV] [RFC] Deprecations for PHP 7.1 From: me@stephencoakley.com (Stephen Coakley) On 02/18/2016 04:45 PM, Zeev Suraski wrote: > >> With rand functions, I don't think we need to touch them. For some >> applications, low-key randomness is just fine - if you need to shuffle >> array of 20 elements or randomize unit test to ensure you're not testing >> same value all the time, low-quality randomness is completely fine. For >> other applications, there are superior solutions and everybody who needs >> them already uses them, but again I see no value in removing those >> functions. It would only cause more breakage and make adoption of new >> versions (already horrible) even slower. > > I think the obvious option here is to make rand() and srand() aliases to rand_mt() and srand_mt(), unless I'm missing something very basic, unless I'm missing something very basic here..? I see zero reason to deprecate them and break so much code when we can simply 'upgrade' them at zero cost to both us and users. Aliasing to mt_rand() definitely makes sense. With a name like `rand()`, everyone will use it just because it is an obvious and common name for the normal way to generate random numbers. Aliasing essentially will make `rand()` as everyone uses it, better. -- Stephen