gmstrftime_variation7.phpt 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. --TEST--
  2. Test gmstrftime() function : usage variation - Passing day 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. setlocale(LC_ALL, "en_US");
  9. date_default_timezone_set("Asia/Calcutta");
  10. //array of values to iterate over
  11. $inputs = array(
  12. 'Day of the month as a decimal number' => "%d",
  13. 'Day of the year as a decimal number' => "%j",
  14. 'Day of the week as a decimal number' => "%w"
  15. );
  16. // loop through each element of the array for timestamp
  17. foreach($inputs as $key =>$value) {
  18. echo "\n--$key--\n";
  19. var_dump( gmstrftime($value) );
  20. var_dump( gmstrftime($value, $timestamp) );
  21. };
  22. ?>
  23. --EXPECTF--
  24. *** Testing gmstrftime() : usage variation ***
  25. --Day of the month as a decimal number--
  26. Deprecated: Function gmstrftime() is deprecated in %s on line %d
  27. string(%d) "%d"
  28. Deprecated: Function gmstrftime() is deprecated in %s on line %d
  29. string(2) "08"
  30. --Day of the year as a decimal number--
  31. Deprecated: Function gmstrftime() is deprecated in %s on line %d
  32. string(%d) "%d"
  33. Deprecated: Function gmstrftime() is deprecated in %s on line %d
  34. string(3) "221"
  35. --Day of the week as a decimal number--
  36. Deprecated: Function gmstrftime() is deprecated in %s on line %d
  37. string(%d) "%d"
  38. Deprecated: Function gmstrftime() is deprecated in %s on line %d
  39. string(1) "5"