summaryrefslogtreecommitdiff
path: root/ext/standard/tests/general_functions/bug46587.phpt
blob: d9b3044406ffc7bff39bdc6c1833caa0e36c1d27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
--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.