1--TEST-- 2Test gmstrftime() function : usage variation - Checking newline and tab formats which was not supported on Windows before VC14. 3--SKIPIF-- 4<?php 5if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') { 6 die("skip Test is valid for Windows"); 7} 8?> 9--FILE-- 10<?php 11/* Prototype : string gmstrftime(string format [, int timestamp]) 12 * Description: Format a GMT/UCT time/date according to locale settings 13 * Source code: ext/date/php_date.c 14 * Alias to functions: 15 */ 16 17echo "*** Testing gmstrftime() : usage variation ***\n"; 18 19// Initialise function arguments not being substituted (if any) 20$timestamp = gmmktime(8, 8, 8, 8, 8, 2008); 21setlocale(LC_ALL, "C"); 22date_default_timezone_set("Asia/Calcutta"); 23 24//array of values to iterate over 25$inputs = array( 26 'Newline character' => "%n", 27 'Tab character' => "%t" 28); 29 30// loop through each element of the array for timestamp 31 32foreach($inputs as $key =>$value) { 33 echo "\n--$key--\n"; 34 var_dump( gmstrftime($value) ); 35 var_dump( gmstrftime($value, $timestamp) ); 36}; 37 38?> 39===DONE=== 40--EXPECTF-- 41*** Testing gmstrftime() : usage variation *** 42 43--Newline character-- 44string(1) " 45" 46string(1) " 47" 48 49--Tab character-- 50string(1) " " 51string(1) " " 52===DONE=== 53