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-- 39 40Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d 41string(%d) "%d" 42 43Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d 44string(2) "20" 45 46--Month Date Year-- 47 48Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d 49string(%d) "%d/%d/%d" 50 51Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d 52string(8) "08/08/08" 53 54--Year with century-- 55 56Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d 57string(%d) "%d" 58 59Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d 60string(4) "2008" 61 62--Year without century-- 63 64Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d 65string(%d) "%d" 66 67Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d 68string(2) "08" 69