1--TEST-- 2Test getdate() function : usage variation - Passing high positive and negative float values to timestamp. 3--FILE-- 4<?php 5/* Prototype : array getdate([int timestamp]) 6 * Description: Get date/time information 7 * Source code: ext/date/php_date.c 8 * Alias to functions: 9 */ 10 11echo "*** Testing getdate() : usage variation ***\n"; 12date_default_timezone_set("Asia/Calcutta"); 13 14echo "\n-- Testing getdate() function by passing float 12.3456789000e10 value to timestamp --\n"; 15$timestamp = 12.3456789000e10; 16var_dump( getdate($timestamp) ); 17 18echo "\n-- Testing getdate() function by passing float -12.3456789000e10 value to timestamp --\n"; 19$timestamp = -12.3456789000e10; 20var_dump( getdate($timestamp) ); 21?> 22===DONE=== 23--EXPECTREGEX-- 24 25\*\*\* Testing getdate\(\) : usage variation \*\*\* 26 27-- Testing getdate\(\) function by passing float 12.3456789000e10 value to timestamp -- 28array\(11\) { 29 \["seconds"\]=> 30 int\((36|0)\) 31 \["minutes"\]=> 32 int\((43|0)\) 33 \["hours"\]=> 34 int\((10|6)\) 35 \["mday"\]=> 36 int\((26|11)\) 37 \["wday"\]=> 38 int\((2|6)\) 39 \["mon"\]=> 40 int\(3\) 41 \["year"\]=> 42 int\((1935|5882)\) 43 \["yday"\]=> 44 int\((84|69)\) 45 \["weekday"\]=> 46 string\((7|8)\) "(Tuesday|Saturday)" 47 \["month"\]=> 48 string\(5\) "March" 49 \[0\]=> 50 int\((-1097262584|123456789000)\) 51} 52 53-- Testing getdate\(\) function by passing float -12.3456789000e10 value to timestamp -- 54array\(11\) { 55 \["seconds"\]=> 56 int\((44|12|20)\) 57 \["minutes"\]=> 58 int\((39|23)\) 59 \["hours"\]=> 60 int\((0|2|5)\) 61 \["mday"\]=> 62 int\((9|14|23)\) 63 \["wday"\]=> 64 int\((6|-4)\) 65 \["mon"\]=> 66 int\((10|12)\) 67 \["year"\]=> 68 int\((2004|1901|-1943)\) 69 \["yday"\]=> 70 int\((282|347|295)\) 71 \["weekday"\]=> 72 string\((8|7)\) "(Saturday|Unknown)" 73 \["month"\]=> 74 string\((7|8)\) "(October|December)" 75 \[0\]=> 76 int\((1097262584|-2147483648|-123456789000)\) 77} 78===DONE=== 79