]> granicus.if.org Git - php/commitdiff
MFH
authorEdin Kadribasic <edink@php.net>
Mon, 3 Jun 2002 17:57:41 +0000 (17:57 +0000)
committerEdin Kadribasic <edink@php.net>
Mon, 3 Jun 2002 17:57:41 +0000 (17:57 +0000)
NEWS
ext/standard/array.c

diff --git a/NEWS b/NEWS
index 97635947cd6428fa6c114ac37b4bb5ed1b86c0f1..cf187c7552c70e24f3c9843fcdcc4b40c5c0bfe6 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,7 @@
 PHP 4                                                                      NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 2002, Version 4.2.2
+- Fixed array_rand() on thread-safe platforms such as Windows. (Edin)
 - Report the right exit code after a call to exit(). (Edin)
 
 13 May 2002, Version 4.2.1
index 3b010c31acb44d3743361c639c64471e6ce68561..681689c77ff90314ce5f94b97dab9c2a06055fea 100644 (file)
@@ -2880,15 +2880,7 @@ PHP_FUNCTION(array_rand)
        zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(input), &pos);
        while (num_req_val && (key_type = zend_hash_get_current_key_ex(Z_ARRVAL_PP(input), &string_key, &string_key_len, &num_key, 0, &pos)) != HASH_KEY_NON_EXISTANT) {
 
-#ifdef HAVE_RANDOM
-               randval = random();
-#else
-#ifdef HAVE_LRAND48
-               randval = lrand48();
-#else
-               randval = rand();
-#endif
-#endif
+               randval = php_rand(TSRMLS_C);
 
                if ((double)(randval/(PHP_RAND_MAX+1.0)) < (double)num_req_val/(double)num_avail) {
                        /* If we are returning a single result, just do it. */