1--TEST-- 2Test gmstrftime() function : usage variation - Checking date related formats which was not supported on Windows before VC14. 3--FILE-- 4<?php 5echo "*** Testing gmstrftime() : usage variation ***\n"; 6 7// Initialise function arguments not being substituted (if any) 8$timestamp = gmmktime(8, 8, 8, 8, 8, 2008); 9setlocale(LC_ALL, "C"); 10date_default_timezone_set("Asia/Calcutta"); 11 12//array of values to iterate over 13$inputs = array( 14 'Century number' => "%C", 15 'Month Date Year' => "%D", 16 'Year with century' => "%G", 17 'Year without century' => "%g", 18); 19 20// loop through each element of the array for timestamp 21 22foreach($inputs as $key =>$value) { 23 echo "\n--$key--\n"; 24 var_dump( gmstrftime($value) ); 25 var_dump( gmstrftime($value, $timestamp) ); 26}; 27 28?> 29--EXPECTF-- 30*** Testing gmstrftime() : usage variation *** 31 32--Century number-- 33 34Deprecated: Function gmstrftime() is deprecated in %s on line %d 35string(2) "%d" 36 37Deprecated: Function gmstrftime() is deprecated in %s on line %d 38string(2) "20" 39 40--Month Date Year-- 41 42Deprecated: Function gmstrftime() is deprecated in %s on line %d 43string(%d) "%d/%d/%d" 44 45Deprecated: Function gmstrftime() is deprecated in %s on line %d 46string(8) "08/08/08" 47 48--Year with century-- 49 50Deprecated: Function gmstrftime() is deprecated in %s on line %d 51string(%d) "%d" 52 53Deprecated: Function gmstrftime() is deprecated in %s on line %d 54string(4) "2008" 55 56--Year without century-- 57 58Deprecated: Function gmstrftime() is deprecated in %s on line %d 59string(2) "%d" 60 61Deprecated: Function gmstrftime() is deprecated in %s on line %d 62string(2) "08" 63