strftime_variation9.phpt 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. --TEST--
  2. Test strftime() function : usage variation - Checking week related formats which was not supported on Windows before VC14.
  3. --FILE--
  4. <?php
  5. echo "*** Testing strftime() : usage variation ***\n";
  6. // Initialise function arguments not being substituted (if any)
  7. setlocale(LC_ALL, "C");
  8. date_default_timezone_set("Asia/Calcutta");
  9. $timestamp = mktime(8, 8, 8, 8, 8, 2008);
  10. //array of values to iterate over
  11. $inputs = array(
  12. 'The ISO 8601:1988 week number' => "%V",
  13. 'Weekday as decimal' => "%u",
  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. --The ISO 8601:1988 week number--
  25. Deprecated: Function strftime() is deprecated in %s on line %d
  26. string(2) "%d"
  27. Deprecated: Function strftime() is deprecated in %s on line %d
  28. string(2) "32"
  29. --Weekday as decimal--
  30. Deprecated: Function strftime() is deprecated in %s on line %d
  31. string(1) "%d"
  32. Deprecated: Function strftime() is deprecated in %s on line %d
  33. string(1) "5"