xref: /PHP-7.0/ext/standard/tests/array/min.phpt (revision f2fc267e)
1--TEST--
2min() tests
3--INI--
4precision=14
5--FILE--
6<?php
7
8var_dump(min());
9var_dump(min(1));
10var_dump(min(array()));
11var_dump(min(new stdclass));
12var_dump(min(2,1,2));
13var_dump(min(2.1,2.11,2.09));
14var_dump(min("", "t", "b"));
15var_dump(min(false, true, false));
16var_dump(min(true, false, true));
17var_dump(min(1, true, false, true));
18var_dump(min(0, true, false, true));
19
20echo "Done\n";
21?>
22--EXPECTF--
23Warning: min() expects at least 1 parameter, 0 given in %s on line 3
24NULL
25
26Warning: min(): When only one parameter is given, it must be an array in %s on line 4
27NULL
28
29Warning: min(): Array must contain at least one element in %s on line 5
30bool(false)
31
32Warning: min(): When only one parameter is given, it must be an array in %s on line 6
33NULL
34int(1)
35float(2.09)
36string(0) ""
37bool(false)
38bool(false)
39bool(false)
40int(0)
41Done
42