Annotation of embedaddon/php/ext/date/tests/gmstrftime_variation3.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test gmstrftime() function : usage variation - Passing week related format strings to format argument.
3: --FILE--
4: <?php
5: /* Prototype : string gmstrftime(string format [, int timestamp])
6: * Description: Format a GMT/UCT time/date according to locale settings
7: * Source code: ext/date/php_date.c
8: * Alias to functions:
9: */
10:
11: echo "*** Testing gmstrftime() : usage variation ***\n";
12:
13: // Initialise function arguments not being substituted (if any)
14: $timestamp = gmmktime(8, 8, 8, 8, 8, 2008);
15:
16: //array of values to iterate over
17: $inputs = array(
18: 'Abbreviated weekday name' => "%a",
19: 'Full weekday name' => "%A",
20: 'Week number of the year' => "%U",
21: 'Week number of the year in decimal number' => "%W",
22: );
23:
24: // loop through each element of the array for timestamp
25:
26: foreach($inputs as $key =>$value) {
27: echo "\n--$key--\n";
28: var_dump( gmstrftime($value) );
29: var_dump( gmstrftime($value, $timestamp) );
30: };
31:
32: ?>
33: ===DONE===
34: --EXPECTF--
35: *** Testing gmstrftime() : usage variation ***
36:
37: --Abbreviated weekday name--
38: string(%d) "%s"
39: string(3) "Fri"
40:
41: --Full weekday name--
42: string(%d) "%s"
43: string(6) "Friday"
44:
45: --Week number of the year--
46: string(%d) "%d"
47: string(2) "31"
48:
49: --Week number of the year in decimal number--
50: string(%d) "%d"
51: string(2) "31"
52: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>