009_win32.phpt 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. --TEST--
  2. strftime() and gmstrftime() tests
  3. --SKIPIF--
  4. <?php
  5. if (substr(PHP_OS, 0, 3) != 'WIN') die('skip only windows test.');
  6. if (false === setlocale(LC_TIME, "en-us")) die("skip, couldn't set the locale to en-us");
  7. ?>
  8. --FILE--
  9. <?php
  10. date_default_timezone_set('Asia/Jerusalem');
  11. $loc = setlocale(LC_TIME, "0");
  12. setlocale(LC_TIME, "en-us");
  13. $t = mktime(0,0,0, 6, 27, 2006);
  14. var_dump(strftime(""));
  15. var_dump(strftime("%a %A %b %B %c %d %H %I %j %m %M %p %S %U %W %w %x %X %y %Y %Z %z %%", $t));
  16. var_dump(strftime("%%q %%a", $t));
  17. var_dump(strftime("blah", $t));
  18. var_dump(gmstrftime(""));
  19. var_dump(gmstrftime("%a %A %b %B %c %d %H %I %j %m %M %p %S %U %W %w %x %X %y %Y %Z %z %%", $t));
  20. var_dump(gmstrftime("%%q %%a", $t));
  21. var_dump(gmstrftime("blah", $t));
  22. echo "Done\n";
  23. setlocale(LC_TIME, $loc);
  24. ?>
  25. --EXPECTF--
  26. Deprecated: Function strftime() is deprecated in %s on line %d
  27. bool(false)
  28. Deprecated: Function strftime() is deprecated in %s on line %d
  29. string(%d) "Tue Tuesday Jun June 6/27/2006 12:00:00 AM 27 00 12 178 06 00 AM 00 26 26 2 6/27/2006 12:00:00 AM 06 2006 %s"
  30. Deprecated: Function strftime() is deprecated in %s on line %d
  31. string(5) "%q %a"
  32. Deprecated: Function strftime() is deprecated in %s on line %d
  33. string(4) "blah"
  34. Deprecated: Function gmstrftime() is deprecated in %s on line %d
  35. bool(false)
  36. Deprecated: Function gmstrftime() is deprecated in %s on line %d
  37. string(%d) "Mon Monday Jun June 6/26/2006 9:00:00 PM 26 21 09 177 06 00 PM 00 26 26 1 6/26/2006 9:00:00 PM 06 2006 %s"
  38. Deprecated: Function gmstrftime() is deprecated in %s on line %d
  39. string(5) "%q %a"
  40. Deprecated: Function gmstrftime() is deprecated in %s on line %d
  41. string(4) "blah"
  42. Done