gmstrftime_variation9.phpt 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. --TEST--
  2. Test gmstrftime() function : usage variation - Checking week related formats which are not supported on Windows.
  3. --SKIPIF--
  4. <?php
  5. if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') {
  6. die("skip Test is not valid for Windows");
  7. }
  8. ?>
  9. --FILE--
  10. <?php
  11. /* Prototype : string gmstrftime(string format [, int timestamp])
  12. * Description: Format a GMT/UCT time/date according to locale settings
  13. * Source code: ext/date/php_date.c
  14. * Alias to functions:
  15. */
  16. echo "*** Testing gmstrftime() : usage variation ***\n";
  17. // Initialise function arguments not being substituted (if any)
  18. $timestamp = gmmktime(8, 8, 8, 8, 8, 2008);
  19. setlocale(LC_ALL, "en_US");
  20. date_default_timezone_set("Asia/Calcutta");
  21. //array of values to iterate over
  22. $inputs = array(
  23. 'The ISO 8601:1988 week number' => "%V",
  24. 'Weekday as decimal' => "%u",
  25. );
  26. // loop through each element of the array for timestamp
  27. foreach($inputs as $key =>$value) {
  28. echo "\n--$key--\n";
  29. var_dump( gmstrftime($value) );
  30. var_dump( gmstrftime($value, $timestamp) );
  31. };
  32. ?>
  33. ===DONE===
  34. --EXPECTF--
  35. *** Testing gmstrftime() : usage variation ***
  36. --The ISO 8601:1988 week number--
  37. bool(false)
  38. bool(false)
  39. --Weekday as decimal--
  40. bool(false)
  41. bool(false)
  42. ===DONE===