gmdate_variation4.phpt 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. --TEST--
  2. Test gmdate() function : usage variation - Passing textual representation of day formats.
  3. --FILE--
  4. <?php
  5. /* Prototype : string gmdate(string format [, long timestamp])
  6. * Description: Format a GMT date/time
  7. * Source code: ext/date/php_date.c
  8. * Alias to functions:
  9. */
  10. echo "*** Testing gmdate() : usage variation ***\n";
  11. // Initialise all required variables
  12. date_default_timezone_set('UTC');
  13. $timestamp = mktime(8, 8, 8, 8, 8, 2008);
  14. echo "\n-- Testing gmdate() function with partial textual representation of day --\n";
  15. var_dump( gmdate('D') );
  16. var_dump( gmdate('D', $timestamp) );
  17. echo "\n-- Testing gmdate() function with full textual representation of day --\n";
  18. var_dump( gmdate('l') );
  19. var_dump( gmdate('l', $timestamp) );
  20. echo "\n-- Testing gmdate() function with English ordinal suffix --\n";
  21. var_dump( gmdate('S') );
  22. var_dump( gmdate('S', $timestamp) );
  23. ?>
  24. ===DONE===
  25. --EXPECTF--
  26. *** Testing gmdate() : usage variation ***
  27. -- Testing gmdate() function with partial textual representation of day --
  28. string(%d) "%s"
  29. string(3) "Fri"
  30. -- Testing gmdate() function with full textual representation of day --
  31. string(%d) "%s"
  32. string(6) "Friday"
  33. -- Testing gmdate() function with English ordinal suffix --
  34. string(%d) "%s"
  35. string(2) "th"
  36. ===DONE===