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