1--TEST--
2IntlCalendar::createInstance() argument variations
3--SKIPIF--
4<?php
5if (!extension_loaded('intl'))
6    die('skip intl extension not enabled');
7--FILE--
8<?php
9ini_set("intl.error_level", E_WARNING);
10ini_set("intl.default_locale", "nl");
11
12date_default_timezone_set('Europe/Amsterdam');
13
14$cal = intlcal_create_instance('Europe/Amsterdam');
15print_R($cal->getTimeZone());
16print_R($cal->getLocale(Locale::ACTUAL_LOCALE));
17echo "\n";
18
19$cal = intlcal_create_instance('Europe/Lisbon', null);
20print_R($cal->getTimeZone());
21print_R($cal->getLocale(Locale::ACTUAL_LOCALE));
22echo "\n";
23
24$cal = intlcal_create_instance(IntlTimeZone::createTimeZone('Europe/Lisbon'));
25print_R($cal->getTimeZone());
26print_R($cal->getLocale(Locale::ACTUAL_LOCALE));
27echo "\n";
28
29$cal = intlcal_create_instance(null, "pt");
30print_R($cal->getTimeZone());
31print_R($cal->getLocale(Locale::ACTUAL_LOCALE));
32echo "\n";
33
34$cal = intlcal_create_instance("Europe/Lisbon", "pt");
35print_R($cal->getTimeZone());
36print_R($cal->getLocale(Locale::ACTUAL_LOCALE));
37echo "\n";
38
39?>
40--EXPECTF--
41IntlTimeZone Object
42(
43    [valid] => 1
44    [id] => Europe/Amsterdam
45    [rawOffset] => 3600000
46    [currentOffset] => %d
47)
48nl
49IntlTimeZone Object
50(
51    [valid] => 1
52    [id] => Europe/Lisbon
53    [rawOffset] => 0
54    [currentOffset] => %d
55)
56nl
57IntlTimeZone Object
58(
59    [valid] => 1
60    [id] => Europe/Lisbon
61    [rawOffset] => 0
62    [currentOffset] => %d
63)
64nl
65IntlTimeZone Object
66(
67    [valid] => 1
68    [id] => Europe/Amsterdam
69    [rawOffset] => 3600000
70    [currentOffset] => %d
71)
72pt
73IntlTimeZone Object
74(
75    [valid] => 1
76    [id] => Europe/Lisbon
77    [rawOffset] => 0
78    [currentOffset] => %d
79)
80pt
81