1--TEST--
2IntlCalendar::fieldDifference(): 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->fieldDifference($c, 2, 3));
16var_dump($c->fieldDifference(INF, 2));
17var_dump($c->fieldDifference(1));
18
19var_dump(intlcal_field_difference($c, 0, 1, 2));
20var_dump(intlcal_field_difference(1, 0, 1));
21--EXPECTF--
22Warning: IntlCalendar::fieldDifference() expects exactly 2 parameters, 3 given in %s on line %d
23
24Warning: IntlCalendar::fieldDifference(): intlcal_field_difference: bad arguments in %s on line %d
25bool(false)
26
27Warning: IntlCalendar::fieldDifference(): intlcal_field_difference: Call to ICU method has failed in %s on line %d
28bool(false)
29
30Warning: IntlCalendar::fieldDifference() expects exactly 2 parameters, 1 given in %s on line %d
31
32Warning: IntlCalendar::fieldDifference(): intlcal_field_difference: bad arguments in %s on line %d
33bool(false)
34
35Warning: intlcal_field_difference() expects exactly 3 parameters, 4 given in %s on line %d
36
37Warning: intlcal_field_difference(): intlcal_field_difference: bad arguments in %s on line %d
38bool(false)
39
40Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_field_difference() must be an instance of IntlCalendar, int given in %s:%d
41Stack trace:
42#0 %s(%d): intlcal_field_difference(1, 0, 1)
43#1 {main}
44  thrown in %s on line %d
45