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