Re: [RFC] Deprecations for PHP 7.1
| From: | Stephen Coakley | Date: | Fri, 04 Mar 2016 18:37:36 +0000 |
| Subject: | Re: [RFC] Deprecations for PHP 7.1 | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-91504@lists.php.net to get a copy of this message | ||
On 02/18/2016 04:45 PM, Zeev Suraski wrote:
Aliasing to mt_rand() definitely makes sense. With a name likeWith 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.
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