1--TEST-- 2Test date_sunrise() function : usage variation - Passing high positive and negative float values to time argument. 3--FILE-- 4<?php 5/* Prototype : mixed date_sunrise(mixed time [, int format [, float latitude [, float longitude [, float zenith [, float gmt_offset]]]]]) 6 * Description: Returns time of sunrise for a given day and location 7 * Source code: ext/date/php_date.c 8 * Alias to functions: 9 */ 10 11echo "*** Testing date_sunrise() : 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_sunrise() function by passing float 12.3456789000e10 value to time --\n"; 22$time = 12.3456789000e10; 23var_dump( date_sunrise($time, SUNFUNCS_RET_STRING, $latitude, $longitude, $zenith, $gmt_offset) ); 24var_dump( date_sunrise($time, SUNFUNCS_RET_DOUBLE, $latitude, $longitude, $zenith, $gmt_offset) ); 25var_dump( date_sunrise($time, SUNFUNCS_RET_TIMESTAMP, $latitude, $longitude, $zenith, $gmt_offset) ); 26 27echo "\n-- Testing date_sunrise() function by passing float -12.3456789000e10 value to time --\n"; 28$time = -12.3456789000e10; 29var_dump( date_sunrise($time, SUNFUNCS_RET_STRING, $latitude, $longitude, $zenith, $gmt_offset) ); 30var_dump( date_sunrise($time, SUNFUNCS_RET_DOUBLE, $latitude, $longitude, $zenith, $gmt_offset) ); 31var_dump( date_sunrise($time, SUNFUNCS_RET_TIMESTAMP, $latitude, $longitude, $zenith, $gmt_offset) ); 32 33?> 34===DONE=== 35--EXPECTREGEX-- 36\*\*\* Testing date_sunrise\(\) : usage variation \*\*\* 37 38-- Testing date_sunrise\(\) function by passing float 12.3456789000e10 value to time -- 39string\(5\) "(07:34|07:49)" 40float\((7.566[0-9]*|7.821[0-9]*)\) 41int\((-1097256359|123456811756)\) 42 43-- Testing date_sunrise\(\) function by passing float -12.3456789000e10 value to time -- 44string\(5\) "(07:42|08:48|08:04)" 45float\((7.713[0-9]*|8.810[0-9]*|8.074[0-9]*)\) 46int\((1097304168|-2147443882|-123456761731)\) 47===DONE=== 48