gmstrftime_variation15.phpt 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. --TEST--
  2. Test gmstrftime() function : usage variation - Checking time related formats which was not supported on Windows before VC14.
  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, "C");
  9. date_default_timezone_set("Asia/Calcutta");
  10. //array of values to iterate over
  11. $inputs = array(
  12. 'Time in a.m/p.m notation' => "%r",
  13. 'Time in 24 hour notation' => "%R",
  14. 'Current time %H:%M:%S format' => "%T",
  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. --Time in a.m/p.m notation--
  26. Deprecated: Function gmstrftime() is deprecated in %s on line %d
  27. string(%d) "%d:%d:%d %c%c"
  28. Deprecated: Function gmstrftime() is deprecated in %s on line %d
  29. string(11) "08:08:08 AM"
  30. --Time in 24 hour notation--
  31. Deprecated: Function gmstrftime() is deprecated in %s on line %d
  32. string(%d) "%d:%d"
  33. Deprecated: Function gmstrftime() is deprecated in %s on line %d
  34. string(5) "08:08"
  35. --Current time %H:%M:%S format--
  36. Deprecated: Function gmstrftime() is deprecated in %s on line %d
  37. string(%d) "%d:%d:%d"
  38. Deprecated: Function gmstrftime() is deprecated in %s on line %d
  39. string(8) "08:08:08"