gmstrftime_variation4.phpt 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. --TEST--
  2. Test gmstrftime() function : usage variation - Passing month 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 month name' => "%b",
  11. 'Full month name' => "%B",
  12. 'Month as decimal' => "%m",
  13. );
  14. // loop through each element of the array for timestamp
  15. foreach($inputs as $key =>$value) {
  16. echo "\n--$key--\n";
  17. var_dump( gmstrftime($value) );
  18. var_dump( gmstrftime($value, $timestamp) );
  19. };
  20. ?>
  21. --EXPECTF--
  22. *** Testing gmstrftime() : usage variation ***
  23. --Abbreviated month name--
  24. Deprecated: Function gmstrftime() is deprecated in %s on line %d
  25. string(%d) "%s"
  26. Deprecated: Function gmstrftime() is deprecated in %s on line %d
  27. string(3) "Aug"
  28. --Full month name--
  29. Deprecated: Function gmstrftime() is deprecated in %s on line %d
  30. string(%d) "%s"
  31. Deprecated: Function gmstrftime() is deprecated in %s on line %d
  32. string(6) "August"
  33. --Month as decimal--
  34. Deprecated: Function gmstrftime() is deprecated in %s on line %d
  35. string(%d) "%d"
  36. Deprecated: Function gmstrftime() is deprecated in %s on line %d
  37. string(2) "08"