1--TEST--
2Basic test for date_sunrise and date_sunset based on example in PHP manual
3--FILE--
4<?php
5
6date_default_timezone_set('UTC');
7
8/* calculate the sunrise time for Lisbon, Portugal
9Latitude: 38.4 North
10Longitude: 9 West
11Zenith ~= 90
12offset: +1 GMT
13*/
14
15echo "Basic test for date_sunrise() and date_sunset()\n";
16
17echo date("D M d Y") . ', sunrise time : ' . date_sunrise(time(), SUNFUNCS_RET_STRING, 38.4, -9, 90, 1) . "\n";
18echo date("D M d Y") . ', sunset time : ' . date_sunset(time(), SUNFUNCS_RET_STRING, 38.4, -9, 90, 1) . "\n";
19
20// Check that calling with just the first parameter works.
21var_dump(gettype(date_sunrise(time())));
22var_dump(gettype(date_sunset(time())));
23
24?>
25--EXPECTF--
26Basic test for date_sunrise() and date_sunset()
27%s %s %d %d, sunrise time : %d:%d
28%s %s %d %d, sunset time : %d:%d
29string(6) "string"
30string(6) "string"
31