1--TEST--
2Test gmdate() function : usage variation - Valid and invalid range of timestamp.
3--FILE--
4<?php
5/* Prototype  : string gmdate(string format [, long timestamp])
6 * Description: Format a GMT date/time
7 * Source code: ext/date/php_date.c
8 * Alias to functions:
9 */
10
11echo "*** Testing gmdate() : usage variation ***\n";
12
13// Initialise all required variables
14date_default_timezone_set('UTC');
15
16$timestamp = mktime(20, 45, 54, 12, 13, 1901);
17echo "\n-- Testing gmdate() function with minimum range of timestamp --\n";
18var_dump( gmdate(DATE_ISO8601, $timestamp) );
19
20$timestamp = mktime(20, 45, 50, 12, 13, 1901);
21echo "\n-- Testing gmdate() function with less than the range of timestamp --\n";
22var_dump( gmdate(DATE_ISO8601, $timestamp) );
23
24echo "\n-- Testing gmdate() function with maximum range of timestamp --\n";
25$timestamp = mktime(03, 14, 07, 1, 19, 2038);
26var_dump( gmdate(DATE_ISO8601, $timestamp) );
27
28echo "\n-- Testing gmdate() function with greater than the range of timestamp --\n";
29$timestamp = mktime(03, 14, 10, 1, 19, 2038);
30var_dump( gmdate(DATE_ISO8601, $timestamp) );
31
32?>
33===DONE===
34--EXPECTREGEX--
35\*\*\* Testing gmdate\(\) : usage variation \*\*\*
36
37-- Testing gmdate\(\) function with minimum range of timestamp --
38string\(24\) "1901-12-13T20:45:54\+0000"
39
40-- Testing gmdate\(\) function with less than the range of timestamp --
41string\(24\) "(1970-01-01T00:00:00\+0000|1901-12-13T20:45:50\+0000)"
42
43-- Testing gmdate\(\) function with maximum range of timestamp --
44string\(24\) "2038-01-19T03:14:07\+0000"
45
46-- Testing gmdate\(\) function with greater than the range of timestamp --
47string\(24\) "(1970-01-01T00:00:00\+0000|2038-01-19T03:14:10\+0000)"
48===DONE===
49