1--TEST--
2Test date_sunset() function : usage variation - Passing high positive and negative float values to time argument.
3--FILE--
4<?php
5/* Prototype  : mixed date_sunset(mixed time [, int format [, float latitude [, float longitude [, float zenith [, float gmt_offset]]]]])
6 * Description: Returns time of sunset for a given day and location
7 * Source code: ext/date/php_date.c
8 * Alias to functions:
9 */
10
11echo "*** Testing date_sunset() : usage variation ***\n";
12
13// GMT is zero for the timezone
14date_default_timezone_set("Asia/Calcutta");
15//Initialise the variables
16$latitude = 38.4;
17$longitude = -9;
18$zenith = 90;
19$gmt_offset = 1;
20
21echo "\n-- Testing date_sunset() function by passing float 12.3456789000e10 value to time --\n";
22$time = 12.3456789000e10;
23var_dump( date_sunset($time, SUNFUNCS_RET_STRING, $latitude, $longitude, $zenith, $gmt_offset) );
24var_dump( date_sunset($time, SUNFUNCS_RET_DOUBLE, $latitude, $longitude, $zenith, $gmt_offset) );
25var_dump( date_sunset($time, SUNFUNCS_RET_TIMESTAMP, $latitude, $longitude, $zenith, $gmt_offset) );
26
27echo "\n-- Testing date_sunset() function by passing float -12.3456789000e10 value to time --\n";
28$time = -12.3456789000e10;
29var_dump( date_sunset($time, SUNFUNCS_RET_STRING, $latitude, $longitude, $zenith, $gmt_offset) );
30var_dump( date_sunset($time, SUNFUNCS_RET_DOUBLE, $latitude, $longitude, $zenith, $gmt_offset) );
31var_dump( date_sunset($time, SUNFUNCS_RET_TIMESTAMP, $latitude, $longitude, $zenith, $gmt_offset) );
32
33?>
34===DONE===
35--EXPECTREGEX--
36\*\*\* Testing date_sunset\(\) : usage variation \*\*\*
37
38-- Testing date_sunset\(\) function by passing float 12.3456789000e10 value to time --
39string\(5\) "(19:49|19:28)"
40float\((19.830[0-9]*|19.830[0-9]*|19.480[0-9]*)\)
41int\((-1097212211|123456853728)\)
42
43-- Testing date_sunset\(\) function by passing float -12.3456789000e10 value to time --
44string\(5\) "(19:03|18:12|18:48)"
45float\((19.056[0-9]*|18.213[0-9]*|18.808[0-9]*)\)
46int\((1097345002|-2147410031|-123456723090)\)
47===DONE===
48