1--TEST-- 2IntlCalendar::get/setRepeatedWallTimeOption(): basic test 3--SKIPIF-- 4<?php 5if (!extension_loaded('intl')) 6 die('skip intl extension not enabled'); 7if (version_compare(INTL_ICU_VERSION, '49') < 0) 8 die('skip for ICU 49+'); 9--FILE-- 10 11<?php 12ini_set("intl.error_level", E_WARNING); 13ini_set("intl.default_locale", "nl"); 14 15date_default_timezone_set('Europe/Amsterdam'); 16 17//28 October 2012, transition from DST 18$intlcal = new IntlGregorianCalendar(2012, 9, 28, 0, 0, 0); 19var_dump($intlcal->setRepeatedWallTimeOption(IntlCalendar::WALLTIME_LAST)); 20var_dump($intlcal->getRepeatedWallTimeOption()); 21$intlcal->set(IntlCalendar::FIELD_HOUR_OF_DAY, 2); 22$intlcal->set(IntlCalendar::FIELD_MINUTE, 30); 23var_dump( 24 strtotime('2012-10-28 02:30:00 +0100'), 25 (int)($intlcal->getTime() /1000) 26); 27 28var_dump(intlcal_set_repeated_wall_time_option($intlcal, IntlCalendar::WALLTIME_FIRST)); 29var_dump(intlcal_get_repeated_wall_time_option($intlcal)); 30$intlcal->set(IntlCalendar::FIELD_HOUR_OF_DAY, 2); 31$intlcal->set(IntlCalendar::FIELD_MINUTE, 30); 32var_dump( 33 strtotime('2012-10-28 02:30:00 +0200'), 34 (int)($intlcal->getTime() /1000) 35); 36 37?> 38==DONE== 39--EXPECT-- 40 41bool(true) 42int(0) 43int(1351387800) 44int(1351387800) 45bool(true) 46int(1) 47int(1351384200) 48int(1351384200) 49==DONE==