1--TEST--
2IntlCalendar::fieldDifference(): bad arguments
3--INI--
4date.timezone=Atlantic/Azores
5--EXTENSIONS--
6intl
7--FILE--
8<?php
9ini_set("intl.error_level", E_WARNING);
10
11$c = new IntlGregorianCalendar(NULL, 'pt_PT');
12
13try {
14    var_dump($c->fieldDifference($c, 2, 3));
15} catch (TypeError $e) {
16    echo $e->getMessage(), "\n";
17}
18var_dump($c->fieldDifference(INF, 2));
19
20try {
21    var_dump(intlcal_field_difference($c, 0, 1, 2));
22} catch (TypeError $e) {
23    echo $e->getMessage(), "\n";
24}
25var_dump(intlcal_field_difference(1, 0, 1));
26?>
27--EXPECTF--
28IntlCalendar::fieldDifference() expects exactly 2 arguments, 3 given
29
30Warning: IntlCalendar::fieldDifference(): intlcal_field_difference: Call to ICU method has failed in %s on line %d
31bool(false)
32intlcal_field_difference() expects exactly 3 arguments, 4 given
33
34Fatal error: Uncaught TypeError: intlcal_field_difference(): Argument #1 ($calendar) must be of type IntlCalendar, int given in %s:%d
35Stack trace:
36#0 %s(%d): intlcal_field_difference(1, 0, 1)
37#1 {main}
38  thrown in %s on line %d
39