1--TEST-- 2IntlTimeZone::getIDForWindowsID basic test 3--SKIPIF-- 4<?php 5if (!extension_loaded('intl')) 6 die('skip intl extension not enabled'); ?> 7<?php if (version_compare(INTL_ICU_VERSION, '58.1') < 0) die('skip for ICU >= 58.1'); ?> 8--FILE-- 9<?php 10 11$tzs = array( 12 'Gnomeregan' => array(NULL), 13 'India Standard Time' => array(NULL), 14 'Pacific Standard Time' => array('001', 'CA', 'MX', 'US', 'ZZ'), 15 'Romance Standard Time' => array('001', 'BE', 'DK', 'ES', 'FR'), 16); 17 18foreach ($tzs as $tz => $regions) { 19 echo "** $tz\n"; 20 foreach ($regions as $region) { 21 var_dump(IntlTimeZone::getIDForWindowsID($tz, $region)); 22 if (intl_get_error_code() != U_ZERO_ERROR) { 23 echo "Error: ", intl_get_error_message(), "\n"; 24 } 25 } 26} 27--EXPECT-- 28** Gnomeregan 29bool(false) 30Error: intltz_get_windows_id: Unknown windows timezone: U_ILLEGAL_ARGUMENT_ERROR 31** India Standard Time 32string(13) "Asia/Calcutta" 33** Pacific Standard Time 34string(19) "America/Los_Angeles" 35string(17) "America/Vancouver" 36string(19) "America/Los_Angeles" 37string(19) "America/Los_Angeles" 38string(7) "PST8PDT" 39** Romance Standard Time 40string(12) "Europe/Paris" 41string(15) "Europe/Brussels" 42string(17) "Europe/Copenhagen" 43string(13) "Europe/Madrid" 44string(12) "Europe/Paris" 45