1--TEST--
2IntlCalendar::get/Least/Greatest/Minimum/Maximum(): bad arguments
3--INI--
4date.timezone=Atlantic/Azores
5--SKIPIF--
6<?php
7if (!extension_loaded('intl'))
8	die('skip intl extension not enabled');
9--FILE--
10<?php
11ini_set("intl.error_level", E_WARNING);
12
13$c = new IntlGregorianCalendar(NULL, 'pt_PT');
14
15var_dump($c->getLeastMaximum());
16var_dump($c->getMaximum());
17var_dump($c->getGreatestMinimum());
18var_dump($c->getMinimum());
19
20var_dump($c->getLeastMaximum(-1));
21var_dump($c->getMaximum(-1));
22var_dump($c->getGreatestMinimum(-1));
23var_dump($c->getMinimum(-1));
24
25var_dump(intlcal_get_least_maximum($c, -1));
26var_dump(intlcal_get_maximum($c, -1));
27var_dump(intlcal_get_greatest_minimum($c, -1));
28var_dump(intlcal_get_minimum($c, -1));
29
30function eh($errno, $errstr) {
31echo "error: $errno, $errstr\n";
32}
33set_error_handler('eh');
34
35var_dump(intlcal_get_least_maximum(1, 1));
36var_dump(intlcal_get_maximum(1, 1));
37var_dump(intlcal_get_greatest_minimum(1, -1));
38var_dump(intlcal_get_minimum(1, -1));
39
40--EXPECTF--
41
42Warning: IntlCalendar::getLeastMaximum() expects exactly 1 parameter, 0 given in %s on line %d
43
44Warning: IntlCalendar::getLeastMaximum(): intlcal_get_least_maximum: bad arguments in %s on line %d
45bool(false)
46
47Warning: IntlCalendar::getMaximum() expects exactly 1 parameter, 0 given in %s on line %d
48
49Warning: IntlCalendar::getMaximum(): intlcal_get_maximum: bad arguments in %s on line %d
50bool(false)
51
52Warning: IntlCalendar::getGreatestMinimum() expects exactly 1 parameter, 0 given in %s on line %d
53
54Warning: IntlCalendar::getGreatestMinimum(): intlcal_get_greatest_minimum: bad arguments in %s on line %d
55bool(false)
56
57Warning: IntlCalendar::getMinimum() expects exactly 1 parameter, 0 given in %s on line %d
58
59Warning: IntlCalendar::getMinimum(): intlcal_get_minimum: bad arguments in %s on line %d
60bool(false)
61
62Warning: IntlCalendar::getLeastMaximum(): intlcal_get_least_maximum: invalid field in %s on line %d
63bool(false)
64
65Warning: IntlCalendar::getMaximum(): intlcal_get_maximum: invalid field in %s on line %d
66bool(false)
67
68Warning: IntlCalendar::getGreatestMinimum(): intlcal_get_greatest_minimum: invalid field in %s on line %d
69bool(false)
70
71Warning: IntlCalendar::getMinimum(): intlcal_get_minimum: invalid field in %s on line %d
72bool(false)
73
74Warning: intlcal_get_least_maximum(): intlcal_get_least_maximum: invalid field in %s on line %d
75bool(false)
76
77Warning: intlcal_get_maximum(): intlcal_get_maximum: invalid field in %s on line %d
78bool(false)
79
80Warning: intlcal_get_greatest_minimum(): intlcal_get_greatest_minimum: invalid field in %s on line %d
81bool(false)
82
83Warning: intlcal_get_minimum(): intlcal_get_minimum: invalid field in %s on line %d
84bool(false)
85error: 4096, Argument 1 passed to intlcal_get_least_maximum() must be an instance of IntlCalendar, integer given
86error: 2, intlcal_get_least_maximum() expects parameter 1 to be IntlCalendar, integer given
87error: 2, intlcal_get_least_maximum(): intlcal_get_least_maximum: bad arguments
88bool(false)
89error: 4096, Argument 1 passed to intlcal_get_maximum() must be an instance of IntlCalendar, integer given
90error: 2, intlcal_get_maximum() expects parameter 1 to be IntlCalendar, integer given
91error: 2, intlcal_get_maximum(): intlcal_get_maximum: bad arguments
92bool(false)
93error: 4096, Argument 1 passed to intlcal_get_greatest_minimum() must be an instance of IntlCalendar, integer given
94error: 2, intlcal_get_greatest_minimum() expects parameter 1 to be IntlCalendar, integer given
95error: 2, intlcal_get_greatest_minimum(): intlcal_get_greatest_minimum: bad arguments
96bool(false)
97error: 4096, Argument 1 passed to intlcal_get_minimum() must be an instance of IntlCalendar, integer given
98error: 2, intlcal_get_minimum() expects parameter 1 to be IntlCalendar, integer given
99error: 2, intlcal_get_minimum(): intlcal_get_minimum: bad arguments
100bool(false)
101