1--TEST-- 2Test date_sunset() function : usage variation - Checking sunrise for consecutive days in specific timezone 3--INI-- 4error_reporting=E_ALL&~E_DEPRECATED 5--FILE-- 6<?php 7echo "*** Testing date_sunset() : usage variation ***\n"; 8 9//Timezones with required data for date_sunrise 10$inputs = array ( 11 //Timezone with Latitude, Longitude and GMT offset 12 "Pacific/Samoa" => array ("Latitude" => -14.24, "Longitude" => -170.72, "GMT" => -11), 13 "US/Alaska" => array ("Latitude" => 61, "Longitude" => -150 , "GMT" => -9), 14 "America/Chicago" => array ("Latitude" => 41.85, "Longitude" => -87.65 , "GMT" => -5), 15 "America/Montevideo" => array ("Latitude" => -34.88, "Longitude" => -56.18 , "GMT" => -3), 16 "Africa/Casablanca" => array ("Latitude" => 33.65, "Longitude" => "-7.58", "GMT" => 0), 17 "Europe/Moscow" => array ("Latitude" => 55.75, "Longitude" => 37.58, "GMT" => 4), 18 "Asia/Hong_Kong" => array ("Latitude" => 22.28, "Longitude" => 114.15 , "GMT" => 8), 19 "Australia/Brisbane" => array ("Latitude" => -27.46, "Longitude" => 153.2 , "GMT" => 10), 20 "Pacific/Wallis" => array ("Latitude" => -13.3, "Longitude" => -176.16, "GMT" => 12), 21); 22 23foreach($inputs as $timezone => $value) { 24 echo "\n--$timezone--\n"; 25 date_default_timezone_set($timezone); 26 $time = mktime(8, 8, 8, 8, 11, 2008); 27 var_dump( date_sunset($time, SUNFUNCS_RET_STRING, $value["Latitude"], $value["Longitude"], 90, $value["GMT"] )); 28 $time = mktime(8, 8, 8, 8, 12, 2008); 29 var_dump( date_sunset($time, SUNFUNCS_RET_STRING, $value["Latitude"], $value["Longitude"], 90, $value["GMT"]) ); 30} 31?> 32--EXPECT-- 33*** Testing date_sunset() : usage variation *** 34 35--Pacific/Samoa-- 36string(5) "18:13" 37string(5) "18:13" 38 39--US/Alaska-- 40string(5) "21:02" 41string(5) "20:59" 42 43--America/Chicago-- 44string(5) "19:52" 45string(5) "19:51" 46 47--America/Montevideo-- 48string(5) "18:08" 49string(5) "18:08" 50 51--Africa/Casablanca-- 52string(5) "19:18" 53string(5) "19:17" 54 55--Europe/Moscow-- 56string(5) "21:10" 57string(5) "21:08" 58 59--Asia/Hong_Kong-- 60string(5) "18:55" 61string(5) "18:54" 62 63--Australia/Brisbane-- 64string(5) "17:21" 65string(5) "17:21" 66 67--Pacific/Wallis-- 68string(5) "17:36" 69string(5) "17:36" 70