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