1--TEST--
2IntlCalendar::clear(): bad arguments
3--INI--
4date.timezone=Atlantic/Azores
5--EXTENSIONS--
6intl
7--FILE--
8<?php
9
10$c = new IntlGregorianCalendar(NULL, 'pt_PT');
11
12try {
13    var_dump($c->clear(-1));
14} catch (\ValueError $e) {
15    echo $e->getMessage() . \PHP_EOL;
16}
17try {
18    var_dump(intlcal_clear($c, -1));
19} catch (\ValueError $e) {
20    echo $e->getMessage() . \PHP_EOL;
21}
22
23try {
24    var_dump(intlcal_clear(1, 2));
25} catch (\TypeError $e) {
26    echo $e->getMessage() . \PHP_EOL;
27}
28?>
29--EXPECT--
30IntlCalendar::clear(): Argument #1 ($field) must be a valid field
31intlcal_clear(): Argument #2 ($field) must be a valid field
32intlcal_clear(): Argument #1 ($calendar) must be of type IntlCalendar, int given
33