1--TEST--
2IntlGregorianCalendar::__construct(): basic
3--EXTENSIONS--
4intl
5--FILE--
6<?php
7ini_set("intl.error_level", E_WARNING);
8ini_set("intl.default_locale", "nl");
9
10date_default_timezone_set('Europe/Amsterdam');
11
12$intlcal = intlgregcal_create_instance();
13var_dump($intlcal->getTimeZone()->getId());
14var_dump($intlcal->getLocale(1));
15
16$intlcal = new IntlGregorianCalendar('Europe/Lisbon', NULL);
17var_dump($intlcal->getTimeZone()->getId());
18var_dump($intlcal->getLocale(1));
19
20$intlcal = new IntlGregorianCalendar(NULL, 'pt_PT');
21var_dump($intlcal->getTimeZone()->getId());
22var_dump($intlcal->getLocale(1));
23
24$intlcal = new IntlGregorianCalendar('Europe/Lisbon', 'pt_PT');
25var_dump($intlcal->getTimeZone()->getId());
26var_dump($intlcal->getLocale(1));
27
28$intlcal = new IntlGregorianCalendar('Europe/Paris', 'fr_CA', NULL, NULL, NULL, NULL);
29var_dump($intlcal->getTimeZone()->getId());
30var_dump($intlcal->getLocale(1));
31
32var_dump($intlcal->getType());
33?>
34--EXPECTF--
35Deprecated: Function intlgregcal_create_instance() is deprecated since 8.4, use IntlGregorianCalendar::__construct(), IntlGregorianCalendar::createFromDate(), or IntlGregorianCalendar::createFromDateTime() instead in %s on line %d
36string(16) "Europe/Amsterdam"
37string(5) "nl_NL"
38string(13) "Europe/Lisbon"
39string(5) "nl_NL"
40string(16) "Europe/Amsterdam"
41string(5) "pt_PT"
42string(13) "Europe/Lisbon"
43string(5) "pt_PT"
44
45Deprecated: Calling IntlGregorianCalendar::__construct() with more than 2 arguments is deprecated, use either IntlGregorianCalendar::createFromDate() or IntlGregorianCalendar::createFromDateTime() instead in %s on line %d
46string(12) "Europe/Paris"
47string(5) "fr_CA"
48string(9) "gregorian"
49