Annotation of embedaddon/php/ext/date/tests/strtotime3-64bit.phpt, revision 1.1.1.2
1.1 misho 1: --TEST--
2: strtotime() function (64 bit)
3: --SKIPIF--
4: <?php echo PHP_INT_SIZE != 8 ? "skip 64-bit only" : "OK"; ?>
5: --FILE--
6: <?php
7: date_default_timezone_set('Europe/Lisbon');
8: $time = 1150494719; // 16/June/2006
9:
10: $strs = array(
11: '',
12: " \t\r\n000",
13: 'yesterday',
14: '22:49:12',
15: '22:49:12 bogusTZ',
16: '22.49.12.42GMT',
17: '22.49.12.42bogusTZ',
18: 't0222',
19: 't0222 t0222',
20: '022233',
21: '022233 bogusTZ',
22: '2-3-2004',
23: '2.3.2004',
24: '20060212T23:12:23UTC',
25: '20060212T23:12:23 bogusTZ',
26: '2006167', //pgydotd
27: 'Jan-15-2006', //pgtextshort
28: '2006-Jan-15', //pgtextreverse
29: '10/Oct/2000:13:55:36 +0100', //clf
30: '10/Oct/2000:13:55:36 +00100', //clf
31: '2006',
32: '1986', // year
33: 'JAN',
34: 'January',
35: );
36:
37: foreach ($strs as $str) {
38: $t = strtotime($str, $time);
39: if (is_integer($t)) {
40: var_dump(date(DATE_RFC2822, $t));
41: } else {
42: var_dump($t);
43: }
44: }
45:
46: ?>
47: --EXPECT--
48: bool(false)
49: bool(false)
50: string(31) "Thu, 15 Jun 2006 00:00:00 +0100"
51: string(31) "Fri, 16 Jun 2006 22:49:12 +0100"
52: bool(false)
53: string(31) "Fri, 16 Jun 2006 23:49:12 +0100"
54: bool(false)
55: string(31) "Fri, 16 Jun 2006 02:22:00 +0100"
1.1.1.2 ! misho 56: string(31) "Sun, 16 Jun 0222 02:22:00 -0036"
1.1 misho 57: string(31) "Fri, 16 Jun 2006 02:22:33 +0100"
58: bool(false)
59: string(31) "Tue, 02 Mar 2004 00:00:00 +0000"
60: string(31) "Tue, 02 Mar 2004 00:00:00 +0000"
61: string(31) "Sun, 12 Feb 2006 23:12:23 +0000"
62: bool(false)
63: string(31) "Fri, 16 Jun 2006 00:00:00 +0100"
64: string(31) "Sun, 15 Jan 2006 00:00:00 +0000"
65: string(31) "Sun, 15 Jan 2006 00:00:00 +0000"
66: string(31) "Tue, 10 Oct 2000 13:55:36 +0100"
67: bool(false)
68: string(31) "Fri, 16 Jun 2006 20:06:00 +0100"
69: string(31) "Mon, 16 Jun 1986 22:51:59 +0100"
70: string(31) "Mon, 16 Jan 2006 00:00:00 +0000"
71: string(31) "Mon, 16 Jan 2006 00:00:00 +0000"
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>