1--TEST-- 2Test gmstrftime() function : usage variation - Passing day related format strings to format argument. 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, "en_US"); 10date_default_timezone_set("Asia/Calcutta"); 11 12//array of values to iterate over 13$inputs = array( 14 'Day of the month as a decimal number' => "%d", 15 'Day of the year as a decimal number' => "%j", 16 'Day of the week as a decimal number' => "%w" 17); 18 19// loop through each element of the array for timestamp 20 21foreach($inputs as $key =>$value) { 22 echo "\n--$key--\n"; 23 var_dump( gmstrftime($value) ); 24 var_dump( gmstrftime($value, $timestamp) ); 25}; 26 27?> 28--EXPECTF-- 29*** Testing gmstrftime() : usage variation *** 30 31--Day of the month as a decimal number-- 32string(%d) "%d" 33string(2) "08" 34 35--Day of the year as a decimal number-- 36string(%d) "%d" 37string(3) "221" 38 39--Day of the week as a decimal number-- 40string(%d) "%d" 41string(1) "5" 42