summaryrefslogtreecommitdiff
path: root/ext/date/tests/getdate_variation7.phpt
blob: 2088fa1792eeba2a4e4c4d3c82da5d2dc6a3a0d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
--TEST--
Test getdate() function : usage variation - Passing high positive and negative float values to timestamp.
--FILE--
<?php
/* Prototype  : array getdate([int timestamp])
 * Description: Get date/time information 
 * Source code: ext/date/php_date.c
 * Alias to functions: 
 */

echo "*** Testing getdate() : usage variation ***\n";
date_default_timezone_set("Asia/Calcutta");

echo "\n-- Testing getdate() function by passing float 12.3456789000e10 value to timestamp --\n";
$timestamp = 12.3456789000e10;
var_dump( getdate($timestamp) );

echo "\n-- Testing getdate() function by passing float -12.3456789000e10 value to timestamp --\n";
$timestamp = -12.3456789000e10;
var_dump( getdate($timestamp) );
?>
===DONE===
--EXPECTREGEX--

\*\*\* Testing getdate\(\) : usage variation \*\*\*

-- Testing getdate\(\) function by passing float 12.3456789000e10 value to timestamp --
array\(11\) {
  \["seconds"\]=>
  int\((36|0)\)
  \["minutes"\]=>
  int\((43|0)\)
  \["hours"\]=>
  int\((10|6)\)
  \["mday"\]=>
  int\((26|11)\)
  \["wday"\]=>
  int\((2|6)\)
  \["mon"\]=>
  int\(3\)
  \["year"\]=>
  int\((1935|5882)\)
  \["yday"\]=>
  int\((84|69)\)
  \["weekday"\]=>
  string\((7|8)\) "(Tuesday|Saturday)"
  \["month"\]=>
  string\(5\) "March"
  \[0\]=>
  int\((-1097262584|123456789000)\)
}

-- Testing getdate\(\) function by passing float -12.3456789000e10 value to timestamp --
array\(11\) {
  \["seconds"\]=>
  int\((44|12|20)\)
  \["minutes"\]=>
  int\((39|23)\)
  \["hours"\]=>
  int\((0|2|5)\)
  \["mday"\]=>
  int\((9|14|23)\)
  \["wday"\]=>
  int\(0\)
  \["mon"\]=>
  int\((10|12)\)
  \["year"\]=>
  int\((2004|1901|-1943)\)
  \["yday"\]=>
  int\((282|347|295)\)
  \["weekday"\]=>
  string\(6\) "Sunday"
  \["month"\]=>
  string\((7|8)\) "(October|December)"
  \[0\]=>
  int\((1097262584|-2147483648|-123456789000)\)
}
===DONE===