summaryrefslogtreecommitdiff
path: root/ext/standard/array.c
diff options
context:
space:
mode:
authorJames Moore <jmoore@php.net>2001-02-22 00:24:19 +0000
committerJames Moore <jmoore@php.net>2001-02-22 00:24:19 +0000
commit118c015529d69e06b6970bc9185436e60313f31e (patch)
tree5b58f083918e0f364229be2d4a24e88c42a93192 /ext/standard/array.c
parent6e31987376e066b4fb856c2f619e78bb49222e23 (diff)
downloadphp-git-118c015529d69e06b6970bc9185436e60313f31e.tar.gz
Adding php_rand() and php_srand(seed) as a wrapper around random, lrand48 and rand.
Diffstat (limited to 'ext/standard/array.c')
-rw-r--r--ext/standard/array.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 3ca5559e12..490640c15a 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -1364,18 +1364,7 @@ PHP_FUNCTION(range)
static int array_data_shuffle(const void *a, const void*b) {
- return (
- /* This is just a little messy. */
-#ifdef HAVE_RANDOM
- random()
-#else
-#ifdef HAVE_LRAND48
- lrand48()
-#else
- rand()
-#endif
-#endif
- % 2) ? 1 : -1;
+ return (php_rand() % 2) ? 1 : -1;
}