summaryrefslogtreecommitdiff
path: root/ext/standard/rand.c
diff options
context:
space:
mode:
authorRasmus Lerdorf <rasmus@php.net>2001-08-13 07:55:39 +0000
committerRasmus Lerdorf <rasmus@php.net>2001-08-13 07:55:39 +0000
commit4d11d90880e63aaf125d09140775efdb287b9704 (patch)
tree00ed223eb953c2286b1b557548fbc4f73000f55c /ext/standard/rand.c
parent5b2227ea80b0fc5be46bfbdd9dd5ce4ac7825717 (diff)
downloadphp-git-4d11d90880e63aaf125d09140775efdb287b9704.tar.gz
Track down a few more functions that don't check for 0 args and use
faster mechanism
Diffstat (limited to 'ext/standard/rand.c')
-rw-r--r--ext/standard/rand.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/standard/rand.c b/ext/standard/rand.c
index 567ee7277a..4ac3bc0507 100644
--- a/ext/standard/rand.c
+++ b/ext/standard/rand.c
@@ -329,6 +329,10 @@ PHP_FUNCTION(mt_rand)
Returns the maximum value a random number can have */
PHP_FUNCTION(getrandmax)
{
+ if (ZEND_NUM_ARGS() != 0) {
+ WRONG_PARAM_COUNT;
+ }
+
return_value->type = IS_LONG;
return_value->value.lval = PHP_RAND_MAX;
}
@@ -338,6 +342,10 @@ PHP_FUNCTION(getrandmax)
Returns the maximum value a random number from Mersenne Twister can have */
PHP_FUNCTION(mt_getrandmax)
{
+ if (ZEND_NUM_ARGS() != 0) {
+ WRONG_PARAM_COUNT;
+ }
+
return_value->type = IS_LONG;
/*
* Melo: it could be 2^^32 but we only use 2^^31 to maintain