mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00

https://wiki.php.net/rfc/rng_extension https://wiki.php.net/rfc/random_extension_improvement
18 lines
340 B
PHP
18 lines
340 B
PHP
--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.
|