strftime_variation4.phpt 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. --TEST--
  2. Test strftime() function : usage variation - Passing month 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 month name' => "%b",
  12. 'Full month name' => "%B",
  13. 'Month as decimal' => "%m",
  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( strftime($value) );
  19. var_dump( strftime($value, $timestamp) );
  20. };
  21. ?>
  22. --EXPECTF--
  23. *** Testing strftime() : usage variation ***
  24. --Abbreviated month name--
  25. Deprecated: Function strftime() is deprecated in %s on line %d
  26. string(%d) "%s"
  27. Deprecated: Function strftime() is deprecated in %s on line %d
  28. string(3) "Aug"
  29. --Full month name--
  30. Deprecated: Function strftime() is deprecated in %s on line %d
  31. string(%d) "%s"
  32. Deprecated: Function strftime() is deprecated in %s on line %d
  33. string(6) "August"
  34. --Month as decimal--
  35. Deprecated: Function strftime() is deprecated in %s on line %d
  36. string(%d) "%d"
  37. Deprecated: Function strftime() is deprecated in %s on line %d
  38. string(2) "08"