1--TEST--
2IntlDateFormatter: several forms of the calendar arg
3--SKIPIF--
4<?php
5if (!extension_loaded('intl'))	die('skip intl extension not enabled'); ?>
6<?php if (version_compare(INTL_ICU_VERSION, '50.1.2') >=  0) die('skip for ICU < 50.1.2'); ?>
7--FILE--
8<?php
9ini_set("intl.error_level", E_WARNING);
10ini_set("intl.default_locale", "pt_PT");
11ini_set("date.timezone", 'Atlantic/Azores');
12
13$ts = strtotime('2012-01-01 00:00:00 UTC');
14
15$cal = new IntlGregorianCalendar('UTC', NULL);
16$df = new IntlDateFormatter('es_ES', 0, 0, NULL, $cal);
17echo $df->format($ts), "\n";
18
19$cal = IntlCalendar::createInstance('UTC', 'en@calendar=islamic');
20$df = new IntlDateFormatter('es_ES', 0, 0, NULL, $cal);
21echo $df->format($ts), "\n";
22
23//override calendar's timezone
24$cal = new IntlGregorianCalendar('UTC', NULL);
25$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Madrid', $cal);
26echo $df->format($ts), "\n";
27
28//default calendar is gregorian
29$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0);
30echo $df->format($ts), "\n";
31
32//try now with traditional
33$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0, NULL, IntlDateFormatter::TRADITIONAL);
34echo $df->format($ts), "\n";
35
36//the timezone can be overridden when not specifying a calendar
37$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0, 'UTC', IntlDateFormatter::TRADITIONAL);
38echo $df->format($ts), "\n";
39
40$df = new IntlDateFormatter('es_ES', 0, 0, 'UTC', 0);
41echo $df->format($ts), "\n";
42
43?>
44--EXPECTF--
45domingo%S 1 de enero de 2012 00:00:00 GMT
46domingo%S 8 de Safar de 1433 00:00:00 GMT
47domingo%S 1 de enero de 2012 01:00:00 Hora estándar de Europa Central
48sábado%S 31 de diciembre de 2011 d.C. 23:00:00 Hora %Sde las Azores
49sábado%S 7 de Safar de 1433 AH 23:00:00 Hora %Sde las Azores
50domingo%S 8 de Safar de 1433 AH 00:00:00 GMT
51domingo%S 1 de enero de 2012 00:00:00 GMT
52