1--TEST-- 2rand() and mt_rand() tests 3--FILE-- 4<?php 5 6var_dump(mt_rand()); 7var_dump(mt_rand(-1)); 8var_dump(mt_rand(-1,1)); 9var_dump(mt_rand(0,3)); 10 11var_dump(rand()); 12var_dump(rand(-1)); 13var_dump(rand(-1,1)); 14var_dump(rand(0,3)); 15 16var_dump(srand()); 17var_dump(srand(-1)); 18var_dump(srand(array())); 19 20var_dump(mt_srand()); 21var_dump(mt_srand(-1)); 22var_dump(mt_srand(array())); 23 24var_dump(getrandmax()); 25var_dump(getrandmax(1)); 26 27var_dump(mt_getrandmax()); 28var_dump(mt_getrandmax(1)); 29 30echo "Done\n"; 31?> 32--EXPECTF-- 33int(%d) 34 35Warning: mt_rand() expects exactly 2 parameters, 1 given in %s on line %d 36NULL 37int(%i) 38int(%d) 39int(%d) 40 41Warning: rand() expects exactly 2 parameters, 1 given in %s on line %d 42NULL 43int(%i) 44int(%d) 45NULL 46NULL 47 48Warning: srand() expects parameter 1 to be integer, array given in %s on line %d 49NULL 50NULL 51NULL 52 53Warning: mt_srand() expects parameter 1 to be integer, array given in %s on line %d 54NULL 55int(%d) 56 57Warning: getrandmax() expects exactly 0 parameters, 1 given in %s on line %d 58NULL 59int(%d) 60 61Warning: mt_getrandmax() expects exactly 0 parameters, 1 given in %s on line %d 62NULL 63Done 64