gmdate_variation6.phpt 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. --TEST--
  2. Test gmdate() function : usage variation - Passing Month format options to format argument.
  3. --FILE--
  4. <?php
  5. echo "*** Testing gmdate() : usage variation ***\n";
  6. // Initialise all required variables
  7. date_default_timezone_set('UTC');
  8. $timestamp = mktime(8, 8, 8, 8, 8, 2008);
  9. echo "\n-- Testing gmdate() function with full textual representation of month format --\n";
  10. var_dump( gmdate('F') );
  11. var_dump( gmdate('F', $timestamp) );
  12. echo "\n-- Testing gmdate() function with numeric representation of month format --\n";
  13. var_dump( gmdate('m') );
  14. var_dump( gmdate('m', $timestamp) );
  15. echo "\n-- Testing gmdate() function with short textual representation of month format --\n";
  16. var_dump( gmdate('M') );
  17. var_dump( gmdate('M', $timestamp) );
  18. echo "\n-- Testing gmdate() function with numeric representation of month without leading zeros format --\n";
  19. var_dump( gmdate('n') );
  20. var_dump( gmdate('n', $timestamp) );
  21. echo "\n-- Testing gmdate() function with number of days in a month format --\n";
  22. var_dump( gmdate('t') );
  23. var_dump( gmdate('t', $timestamp) );
  24. ?>
  25. --EXPECTF--
  26. *** Testing gmdate() : usage variation ***
  27. -- Testing gmdate() function with full textual representation of month format --
  28. string(%d) "%s"
  29. string(6) "August"
  30. -- Testing gmdate() function with numeric representation of month format --
  31. string(%d) "%d"
  32. string(2) "08"
  33. -- Testing gmdate() function with short textual representation of month format --
  34. string(%d) "%s"
  35. string(3) "Aug"
  36. -- Testing gmdate() function with numeric representation of month without leading zeros format --
  37. string(%d) "%d"
  38. string(1) "8"
  39. -- Testing gmdate() function with number of days in a month format --
  40. string(%d) "%d"
  41. string(2) "31"