1--TEST--
2Test variations in usage of max()
3--FILE--
4<?php
5/*
6 * proto mixed max(mixed arg1 [, mixed arg2 [, mixed ...]])
7 * Function is implemented in ext/standard/array.c
8*/
9
10echo "\n*** Testing arrays  ***\n";
11
12var_dump(max(array(2,1,2)));
13var_dump(max(array(-2,1,2)));
14var_dump(max(array(2.1,2.11,2.09)));
15var_dump(max(array("", "t", "b")));
16var_dump(max(array(false, true, false)));
17var_dump(max(array(true, false, true)));
18var_dump(max(array(1, true, false, true)));
19var_dump(max(array(0, true, false, true)));
20var_dump(max(array(0, 1, array(2,3))));
21var_dump(max(array(2147483645, 2147483646)));
22var_dump(max(array(2147483647, 2147483648)));
23var_dump(max(array(2147483646, 2147483648)));
24var_dump(max(array(-2147483647, -2147483646)));
25var_dump(max(array(-2147483648, -2147483647)));
26var_dump(max(array(-2147483649, -2147483647)));
27
28echo "\nDone\n";
29
30?>
31--EXPECTF--
32*** Testing arrays  ***
33int(2)
34int(2)
35float(2.11)
36string(1) "t"
37bool(true)
38bool(true)
39int(1)
40bool(true)
41array(2) {
42  [0]=>
43  int(2)
44  [1]=>
45  int(3)
46}
47int(2147483646)
48%s(2147483648)
49%s(2147483648)
50int(-2147483646)
51int(-2147483647)
52int(-2147483647)
53
54Done
55