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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
--TEST--
max() tests
--INI--
precision=14
--FILE--
<?php
try {
var_dump(max(1));
} catch (\TypeError $e) {
echo $e->getMessage() . "\n";
}
try {
var_dump(max(array()));
} catch (\ValueError $e) {
echo $e->getMessage() . "\n";
}
try {
var_dump(max(new stdclass));
} catch (\TypeError $e) {
echo $e->getMessage() . "\n";
}
var_dump(max(2,1,2));
var_dump(max(2.1,2.11,2.09));
var_dump(max("", "t", "b"));
var_dump(max(false, true, false));
var_dump(max(true, false, true));
var_dump(max(1, true, false, true));
var_dump(max(0, true, false, true));
?>
--EXPECT--
max(): Argument #1 ($arg) must be of type array, int given
max(): Argument #1 ($arg) must contain at least one element
max(): Argument #1 ($arg) must be of type array, stdClass given
int(2)
float(2.11)
string(1) "t"
bool(true)
bool(true)
int(1)
bool(true)
|