strftime_variation10.phpt 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. --TEST--
  2. Test strftime() function : usage variation - Checking week related formats which are supported other than 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. echo "*** Testing strftime() : usage variation ***\n";
  12. // Initialise function arguments not being substituted (if any)
  13. setlocale(LC_ALL, "en_US");
  14. date_default_timezone_set("Asia/Calcutta");
  15. $timestamp = mktime(8, 8, 8, 8, 8, 2008);
  16. //array of values to iterate over
  17. $inputs = array(
  18. 'The ISO 8601:1988 week number' => "%V",
  19. 'Weekday as decimal' => "%u",
  20. );
  21. // loop through each element of the array for timestamp
  22. foreach($inputs as $key =>$value) {
  23. echo "\n--$key--\n";
  24. var_dump( strftime($value) );
  25. var_dump( strftime($value, $timestamp) );
  26. }
  27. ?>
  28. --EXPECTF--
  29. *** Testing strftime() : usage variation ***
  30. --The ISO 8601:1988 week number--
  31. Deprecated: Function strftime() is deprecated in %s on line %d
  32. string(%d) "%d"
  33. Deprecated: Function strftime() is deprecated in %s on line %d
  34. string(2) "32"
  35. --Weekday as decimal--
  36. Deprecated: Function strftime() is deprecated in %s on line %d
  37. string(%d) "%d"
  38. Deprecated: Function strftime() is deprecated in %s on line %d
  39. string(1) "5"