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