Annotation of embedaddon/php/ext/date/tests/gmstrftime_variation4.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test gmstrftime() function : usage variation - Passing month 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 month name' => "%b",
                     19:       'Full month name' => "%B",
                     20:          'Month as decimal' => "%m",
                     21: );
                     22: 
                     23: // loop through each element of the array for timestamp
                     24: 
                     25: foreach($inputs as $key =>$value) {
                     26:       echo "\n--$key--\n";
                     27:       var_dump( gmstrftime($value) );
                     28:       var_dump( gmstrftime($value, $timestamp) );
                     29: };
                     30: 
                     31: ?>
                     32: ===DONE===
                     33: --EXPECTF--
                     34: *** Testing gmstrftime() : usage variation ***
                     35: 
                     36: --Abbreviated month name--
                     37: string(%d) "%s"
                     38: string(3) "Aug"
                     39: 
                     40: --Full month name--
                     41: string(%d) "%s"
                     42: string(6) "August"
                     43: 
                     44: --Month as decimal--
                     45: string(%d) "%d"
                     46: string(2) "08"
                     47: ===DONE===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>