gmstrftime_variation3.phpt 1.5 KB

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