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