1--TEST-- 2Test date_sunrise() function : usage variation - Checking with North and South poles when Sun is up and down all day 3--INI-- 4error_reporting=E_ALL&~E_DEPRECATED 5--FILE-- 6<?php 7echo "*** Testing date_sunrise() : usage variation ***\n"; 8 9// GMT is zero for the timezone 10date_default_timezone_set("Africa/Casablanca"); 11$time_date = array ( 12 13 //Date at which Sun is up all day at North Pole 14 "12 Aug 2008" => mktime(8, 8, 8, 8, 12, 2008), 15 "13 Aug 2008" => mktime(8, 8, 8, 8, 13, 2008), 16 17 //Date at which Sun is up all day at South Pole 18 "12 Nov 2008" => mktime(8, 8, 8, 11, 12, 2008), 19 "13 Nov 2008" => mktime(8, 8, 8, 11, 13, 2008), 20); 21 22//Iterate over different date and time 23foreach( $time_date as $date => $time ){ 24 echo "\n--$date--\n"; 25 var_dump( date_sunrise($time, SUNFUNCS_RET_STRING, 90, 0 ) ); 26 var_dump( date_sunrise($time, SUNFUNCS_RET_DOUBLE, 90, 0 ) ); 27 var_dump( date_sunrise($time, SUNFUNCS_RET_TIMESTAMP, 90, 0 ) ); 28 var_dump( date_sunrise($time, SUNFUNCS_RET_STRING, -90, 0 ) ); 29 var_dump( date_sunrise($time, SUNFUNCS_RET_DOUBLE, -90, 0 ) ); 30 var_dump( date_sunrise($time, SUNFUNCS_RET_TIMESTAMP, -90, 0 ) ); 31} 32 33?> 34--EXPECT-- 35*** Testing date_sunrise() : usage variation *** 36 37--12 Aug 2008-- 38bool(false) 39bool(false) 40bool(false) 41bool(false) 42bool(false) 43bool(false) 44 45--13 Aug 2008-- 46bool(false) 47bool(false) 48bool(false) 49bool(false) 50bool(false) 51bool(false) 52 53--12 Nov 2008-- 54bool(false) 55bool(false) 56bool(false) 57bool(false) 58bool(false) 59bool(false) 60 61--13 Nov 2008-- 62bool(false) 63bool(false) 64bool(false) 65bool(false) 66bool(false) 67bool(false) 68