File size: 340 Bytes
1e94262 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | --TEST--
Bug #46587 (mt_rand() does not check that max is greater than min).
--FILE--
<?php
var_dump(mt_rand(3,8));
try {
var_dump(mt_rand(8,3));
} catch (ValueError $e) {
echo $e->getMessage(), "\n";
}
echo "Done.\n";
?>
--EXPECTF--
int(%d)
mt_rand(): Argument #2 ($max) must be greater than or equal to argument #1 ($min)
Done.
|