summaryrefslogtreecommitdiff
path: root/ext/standard/tests/general_functions/rand.phpt
blob: 73dec4eb75ff16a076b5bfb9270c1c2815685923 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
--TEST--
rand() and mt_rand() tests
--FILE--
<?php

var_dump(mt_rand());
var_dump(mt_rand(-1,1));
var_dump(mt_rand(0,3));

var_dump(rand());
var_dump(rand(-1,1));
var_dump(rand(0,3));

var_dump(srand());
var_dump(srand(-1));

var_dump(mt_srand());
var_dump(mt_srand(-1));

var_dump(getrandmax());

var_dump(mt_getrandmax());

echo "Done\n";
?>
--EXPECTF--
int(%d)
int(%i)
int(%d)
int(%d)
int(%i)
int(%d)
NULL
NULL
NULL
NULL
int(%d)
int(%d)
Done