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