summaryrefslogtreecommitdiff
path: root/ext/standard/tests/random/random_int_error.phpt
blob: 9b98bdd7c0bc6266842b9e2ce06123a1c950e581 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--TEST--
Test error operation of random_int()
--FILE--
<?php
//-=-=-=-

try {
    $randomInt = random_int();
} catch (TypeError $e) {
    echo $e->getMessage().PHP_EOL;
}

try {
    $randomInt = random_int(42);
} catch (TypeError $e) {
    echo $e->getMessage().PHP_EOL;
}

try {
    $randomInt = random_int(42,0);
} catch (Error $e) {
    echo $e->getMessage().PHP_EOL;
}

?>
--EXPECT--
random_int() expects exactly 2 parameters, 0 given
random_int() expects exactly 2 parameters, 1 given
Minimum value must be less than or equal to the maximum value