1--TEST-- 2IntlTimeZone::toDateTimeZone(): errors 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); 10 11$tz = IntlTimeZone::createTimeZone('Etc/Unknown'); 12 13var_dump($tz->toDateTimeZone('')); 14try { 15 var_dump($tz->toDateTimeZone()); 16} catch (Exception $e) { 17 var_dump($e->getMessage()); 18} 19 20var_dump(intltz_to_date_time_zone()); 21var_dump(intltz_to_date_time_zone(1)); 22 23--EXPECTF-- 24 25Warning: IntlTimeZone::toDateTimeZone() expects exactly 0 parameters, 1 given in %s on line %d 26 27Warning: IntlTimeZone::toDateTimeZone(): intltz_to_date_time_zone: bad arguments in %s on line %d 28bool(false) 29 30Warning: IntlTimeZone::toDateTimeZone(): intltz_to_date_time_zone: DateTimeZone constructor threw exception in %s on line %d 31string(66) "DateTimeZone::__construct(): Unknown or bad timezone (Etc/Unknown)" 32 33Warning: intltz_to_date_time_zone() expects exactly 1 parameter, 0 given in %s on line %d 34 35Warning: intltz_to_date_time_zone(): intltz_to_date_time_zone: bad arguments in %s on line %d 36bool(false) 37 38Fatal error: Uncaught TypeError: Argument 1 passed to intltz_to_date_time_zone() must be an instance of IntlTimeZone, integer given in %s:%d 39Stack trace: 40#0 %s(%d): intltz_to_date_time_zone(1) 41#1 {main} 42 thrown in %s on line %d 43