1--TEST-- 2Test strftime() function : usage variation - Checking date related formats which are supported other than on Windows. 3--SKIPIF-- 4<?php 5if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') { 6 die("skip Test is not valid for Windows"); 7} 8?> 9--FILE-- 10<?php 11echo "*** Testing strftime() : usage variation ***\n"; 12 13// Initialise function arguments not being substituted (if any) 14setlocale(LC_ALL, "en_US"); 15date_default_timezone_set("Asia/Calcutta"); 16$timestamp = mktime(8, 8, 8, 8, 8, 2008); 17 18//array of values to iterate over 19$inputs = array( 20 'Century number' => "%C", 21 'Month Date Year' => "%D", 22 'Year with century' => "%G", 23 'Year without century' => "%g", 24); 25 26// loop through each element of the array for timestamp 27 28foreach($inputs as $key =>$value) { 29 echo "\n--$key--\n"; 30 var_dump( strftime($value) ); 31 var_dump( strftime($value, $timestamp) ); 32} 33 34?> 35--EXPECTF-- 36*** Testing strftime() : usage variation *** 37 38--Century number-- 39string(%d) "%d" 40string(2) "20" 41 42--Month Date Year-- 43string(%d) "%d/%d/%d" 44string(8) "08/08/08" 45 46--Year with century-- 47string(%d) "%d" 48string(4) "2008" 49 50--Year without century-- 51string(%d) "%d" 52string(2) "08" 53