1--TEST--
2Test strftime() function : usage variation - Passing date related format strings to format argument.
3--FILE--
4<?php
5echo "*** Testing strftime() : usage variation ***\n";
6
7// Initialise function arguments not being substituted (if any)
8setlocale(LC_ALL, "en_US");
9date_default_timezone_set("Asia/Calcutta");
10$timestamp = mktime(8, 8, 8, 8, 8, 2008);
11
12//array of values to iterate over
13$inputs = array(
14      'Year as decimal number without a century' => "%y",
15      'Year as decimal number including the century' => "%Y",
16      'Time zone offset' => "%Z",
17      'Time zone offset' => "%z",
18);
19
20// loop through each element of the array for timestamp
21
22foreach($inputs as $key =>$value) {
23      echo "\n--$key--\n";
24      var_dump( strftime($value) );
25      var_dump( strftime($value, $timestamp) );
26};
27
28?>
29--EXPECTF--
30*** Testing strftime() : usage variation ***
31
32--Year as decimal number without a century--
33
34Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
35string(%d) "%d"
36
37Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
38string(2) "08"
39
40--Year as decimal number including the century--
41
42Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
43string(%d) "%d"
44
45Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
46string(4) "2008"
47
48--Time zone offset--
49
50Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
51string(%d) "%s"
52
53Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
54string(%d) "%s"
55