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