1--TEST-- 2Test gmstrftime() function : usage variation - Checking Preferred date and time representation 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} 8if (!setlocale(LC_TIME, "POSIX")) { 9 die("skip Locale POSIX is required to run this test"); 10} 11?> 12--FILE-- 13<?php 14echo "*** Testing gmstrftime() : usage variation ***\n"; 15 16// Initialise function arguments not being substituted (if any) 17$timestamp = gmmktime(8, 8, 8, 8, 8, 2008); 18setlocale(LC_TIME, "POSIX"); 19putenv("LC_TIME=POSIX"); 20date_default_timezone_set("Asia/Calcutta"); 21 22//array of values to iterate over 23$inputs = array( 24 'Preferred date and time representation' => "%c", 25 'Preferred date representation' => "%x", 26 'Preferred time representation' => "%X", 27); 28 29// loop through each element of the array for timestamp 30 31foreach($inputs as $key =>$value) { 32 echo "\n--$key--\n"; 33 var_dump( gmstrftime($value, $timestamp) ); 34}; 35 36?> 37--EXPECTF-- 38*** Testing gmstrftime() : usage variation *** 39 40--Preferred date and time representation-- 41 42Deprecated: Function gmstrftime() is deprecated in %s on line %d 43string(24) "Fri Aug 8 08:08:08 2008" 44 45--Preferred date representation-- 46 47Deprecated: Function gmstrftime() is deprecated in %s on line %d 48string(8) "08/08/08" 49 50--Preferred time representation-- 51 52Deprecated: Function gmstrftime() is deprecated in %s on line %d 53string(8) "08:08:08" 54