1--TEST--
2IntlTimeZone::toDateTimeZone(): errors
3--EXTENSIONS--
4intl
5--FILE--
6<?php
7ini_set("intl.error_level", E_WARNING);
8
9$tz = IntlTimeZone::createTimeZone('Etc/Unknown');
10
11try {
12    var_dump($tz->toDateTimeZone());
13} catch (Exception $e) {
14    var_dump($e->getMessage());
15}
16
17var_dump(intltz_to_date_time_zone(1));
18?>
19--EXPECTF--
20Warning: IntlTimeZone::toDateTimeZone(): intltz_to_date_time_zone: DateTimeZone constructor threw exception in %s on line %d
21string(66) "DateTimeZone::__construct(): Unknown or bad timezone (Etc/Unknown)"
22
23Fatal error: Uncaught TypeError: intltz_to_date_time_zone(): Argument #1 ($timezone) must be of type IntlTimeZone, int given in %s:%d
24Stack trace:
25#0 %s(%d): intltz_to_date_time_zone(1)
26#1 {main}
27  thrown in %s on line %d
28