1--TEST--
2IntlCalendar::equals(): 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
13function eh($errno, $errstr) {
14echo "error: $errno, $errstr\n";
15}
16set_error_handler('eh');
17
18try {
19    var_dump($c->equals());
20} catch (Error $ex) {
21    echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
22}
23try {
24    var_dump($c->equals(new stdclass));
25} catch (Error $ex) {
26    echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
27}
28try {
29    var_dump($c->equals(1, 2));
30} catch (Error $ex) {
31    echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
32}
33
34
35try {
36    var_dump(intlcal_equals($c, array()));
37} catch (Error $ex) {
38    echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
39}
40try {
41    var_dump(intlcal_equals(1, $c));
42} catch (Error $ex) {
43    echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
44}
45?>
46--EXPECT--
47error: 0, IntlCalendar::equals() expects exactly 1 argument, 0 given
48
49error: 0, IntlCalendar::equals(): Argument #1 ($other) must be of type IntlCalendar, stdClass given
50
51error: 0, IntlCalendar::equals() expects exactly 1 argument, 2 given
52
53error: 0, intlcal_equals(): Argument #2 ($other) must be of type IntlCalendar, array given
54
55error: 0, intlcal_equals(): Argument #1 ($calendar) must be of type IntlCalendar, int given
56