1--TEST--
2Test gmdate() function : usage variation - Valid and invalid range of timestamp 64 bits.
3--SKIPIF--
4<?php
5if (PHP_INT_SIZE == 4) die('skip 64 bit only');
6?>
7--FILE--
8<?php
9echo "*** Testing gmdate() : usage variation ***\n";
10
11// Initialise all required variables
12date_default_timezone_set('UTC');
13
14$timestamp = mktime(20, 45, 54, 12, 13, 1901);
15echo "\n-- Testing gmdate() function with minimum range of timestamp --\n";
16var_dump( gmdate(DATE_ISO8601, $timestamp) );
17
18$timestamp = mktime(20, 45, 50, 12, 13, 1901);
19echo "\n-- Testing gmdate() function with less than the range of timestamp --\n";
20var_dump( gmdate(DATE_ISO8601, $timestamp) );
21
22echo "\n-- Testing gmdate() function with maximum range of timestamp --\n";
23$timestamp = mktime(03, 14, 07, 1, 19, 2038);
24var_dump( gmdate(DATE_ISO8601, $timestamp) );
25
26echo "\n-- Testing gmdate() function with greater than the range of timestamp --\n";
27$timestamp = mktime(03, 14, 10, 1, 19, 2038);
28var_dump( gmdate(DATE_ISO8601, $timestamp) );
29
30?>
31--EXPECT--
32*** Testing gmdate() : usage variation ***
33
34-- Testing gmdate() function with minimum range of timestamp --
35string(24) "1901-12-13T20:45:54+0000"
36
37-- Testing gmdate() function with less than the range of timestamp --
38string(24) "1901-12-13T20:45:50+0000"
39
40-- Testing gmdate() function with maximum range of timestamp --
41string(24) "2038-01-19T03:14:07+0000"
42
43-- Testing gmdate() function with greater than the range of timestamp --
44string(24) "2038-01-19T03:14:10+0000"
45