1--TEST--
2IntlDateFormatter::__construct(): bad timezone or calendar
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", "pt_PT");
11ini_set("date.timezone", 'Atlantic/Azores');
12
13function print_exception($e) {
14	echo "\nException: " . $e->getMessage() . " in " . $e->getFile() . " on line " . $e->getLine() . "\n";
15}
16
17try {
18	var_dump(new IntlDateFormatter(NULL, 0, 0, 'bad timezone'));
19} catch (IntlException $e) {
20	print_exception($e);
21}
22try {
23	var_dump(new IntlDateFormatter(NULL, 0, 0, NULL, 3));
24} catch (IntlException $e) {
25	print_exception($e);
26}
27try {
28	var_dump(new IntlDateFormatter(NULL, 0, 0, NULL, new stdclass));
29} catch (IntlException $e) {
30	print_exception($e);
31}
32?>
33==DONE==
34--EXPECTF--
35Exception: IntlDateFormatter::__construct(): datefmt_create: no such time zone: 'bad timezone' in %s on line %d
36
37Exception: IntlDateFormatter::__construct(): datefmt_create: invalid value for calendar type; it must be one of IntlDateFormatter::TRADITIONAL (locale's default calendar) or IntlDateFormatter::GREGORIAN. Alternatively, it can be an IntlCalendar object in %s on line %d
38
39Exception: IntlDateFormatter::__construct(): datefmt_create: Invalid calendar argument; should be an integer or an IntlCalendar instance in %s on line %d
40==DONE==
41