Updates to Tomato RAF including NGINX && PHP
[tomato.git] / release / src / router / php / ext / date / tests / strftime_variation4.phpt
blob6236dd9e7f51a02c95c82c0f00c4c8a583e2df8b
1 --TEST--
2 Test strftime() function : usage variation - Passing month related format strings to format argument.
3 --FILE--
4 <?php
5 /* Prototype  : string strftime(string format [, int timestamp])
6  * Description: Format a local time/date according to locale settings 
7  * Source code: ext/date/php_date.c
8  * Alias to functions: 
9  */
11 echo "*** Testing strftime() : usage variation ***\n";
13 date_default_timezone_set("Asia/Calcutta");
14 // Initialise function arguments not being substituted (if any)
15 $timestamp = mktime(8, 8, 8, 8, 8, 2008);
17 //array of values to iterate over
18 $inputs = array(
19       'Abbreviated month name' => "%b",
20       'Full month name' => "%B",
21           'Month as decimal' => "%m",
24 // loop through each element of the array for timestamp
26 foreach($inputs as $key =>$value) {
27       echo "\n--$key--\n";
28       var_dump( strftime($value) );
29       var_dump( strftime($value, $timestamp) );
33 ===DONE===
34 --EXPECTF--
35 *** Testing strftime() : usage variation ***
37 --Abbreviated month name--
38 string(%d) "%s"
39 string(3) "Aug"
41 --Full month name--
42 string(%d) "%s"
43 string(6) "August"
45 --Month as decimal--
46 string(%d) "%d"
47 string(2) "08"
48 ===DONE===