strftime_variation3.phpt 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. --TEST--
  2. Test strftime() function : usage variation - Passing week related format strings to format argument.
  3. --FILE--
  4. <?php
  5. echo "*** Testing strftime() : usage variation ***\n";
  6. date_default_timezone_set("Asia/Calcutta");
  7. // Initialise function arguments not being substituted (if any)
  8. $timestamp = mktime(8, 8, 8, 8, 8, 2008);
  9. //array of values to iterate over
  10. $inputs = array(
  11. 'Abbreviated weekday name' => "%a",
  12. 'Full weekday name' => "%A",
  13. 'Week number of the year' => "%U",
  14. 'Week number of the year in decimal number' => "%W",
  15. );
  16. // loop through each element of the array for timestamp
  17. foreach($inputs as $key =>$value) {
  18. echo "\n--$key--\n";
  19. var_dump( strftime($value) );
  20. var_dump( strftime($value, $timestamp) );
  21. };
  22. ?>
  23. --EXPECTF--
  24. *** Testing strftime() : usage variation ***
  25. --Abbreviated weekday name--
  26. Deprecated: Function strftime() is deprecated in %s on line %d
  27. string(%d) "%s"
  28. Deprecated: Function strftime() is deprecated in %s on line %d
  29. string(3) "Fri"
  30. --Full weekday name--
  31. Deprecated: Function strftime() is deprecated in %s on line %d
  32. string(%d) "%s"
  33. Deprecated: Function strftime() is deprecated in %s on line %d
  34. string(6) "Friday"
  35. --Week number of the year--
  36. Deprecated: Function strftime() is deprecated in %s on line %d
  37. string(%d) "%d"
  38. Deprecated: Function strftime() is deprecated in %s on line %d
  39. string(2) "31"
  40. --Week number of the year in decimal number--
  41. Deprecated: Function strftime() is deprecated in %s on line %d
  42. string(%d) "%d"
  43. Deprecated: Function strftime() is deprecated in %s on line %d
  44. string(2) "31"