1--TEST-- 2Test gmstrftime() 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 gmstrftime() : usage variation ***\n"; 12 13// Initialise function arguments not being substituted (if any) 14$timestamp = gmmktime(8, 8, 8, 8, 8, 2008); 15setlocale(LC_ALL, "en_US"); 16date_default_timezone_set("Asia/Calcutta"); 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( gmstrftime($value) ); 31 var_dump( gmstrftime($value, $timestamp) ); 32}; 33 34?> 35--EXPECTF-- 36*** Testing gmstrftime() : usage variation *** 37 38--Century number-- 39 40Deprecated: Function gmstrftime() is deprecated in %s on line %d 41string(%d) "%d" 42 43Deprecated: Function gmstrftime() is deprecated in %s on line %d 44string(2) "20" 45 46--Month Date Year-- 47 48Deprecated: Function gmstrftime() is deprecated in %s on line %d 49string(%d) "%d/%d/%d" 50 51Deprecated: Function gmstrftime() is deprecated in %s on line %d 52string(8) "08/08/08" 53 54--Year with century-- 55 56Deprecated: Function gmstrftime() is deprecated in %s on line %d 57string(%d) "%d" 58 59Deprecated: Function gmstrftime() is deprecated in %s on line %d 60string(4) "2008" 61 62--Year without century-- 63 64Deprecated: Function gmstrftime() is deprecated in %s on line %d 65string(%d) "%d" 66 67Deprecated: Function gmstrftime() is deprecated in %s on line %d 68string(2) "08" 69